[gnome-weather/wip/ewlsh/gtk4] Fix icon names.




commit e1b9c58b32d4d88aaeca8f7e8273e70510760dc0
Author: Evan Welsh <contact evanwelsh com>
Date:   Mon Dec 28 00:58:39 2020 -0600

    Fix icon names.

 src/app/city.js           | 3 +--
 src/app/dailyForecast.js  | 3 +--
 src/app/hourlyForecast.js | 8 +-------
 3 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/app/city.js b/src/app/city.js
index b18daa9..d15dcc7 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -201,8 +201,7 @@ var WeatherWidget = GObject.registerClass({
 
         this._worldView.refilter();
 
-        this._conditionsImage.set_from_icon_name(info.get_icon_name());
-        this._conditionsImage.set_pixel_size(84);
+        this._conditionsImage.iconName = `${info.get_icon_name()}-large`;
 
         const [, tempValue] = info.get_value_temp(GWeather.TemperatureUnit.DEFAULT);
         this._temperatureLabel.label = '%.0f°'.format(tempValue);
diff --git a/src/app/dailyForecast.js b/src/app/dailyForecast.js
index 06cb86f..32b7dfe 100644
--- a/src/app/dailyForecast.js
+++ b/src/app/dailyForecast.js
@@ -178,8 +178,7 @@ var DailyForecastFrame = GObject.registerClass(class DailyForecastFrame extends
         let dateFormat = _('%b %e');
         dayEntry.dateLabel.label = day.format(dateFormat);
 
-        dayEntry.image.set_from_icon_name(dayInfo.get_icon_name());
-        dayEntry.image.set_icon_size(1);
+        dayEntry.image.iconName = `${dayInfo.get_icon_name()}-small`;
 
         dayEntry.maxTemperatureLabel.label = Util.getTempString(maxInfo);
         dayEntry.minTemperatureLabel.label = Util.getTempString(minInfo);
diff --git a/src/app/hourlyForecast.js b/src/app/hourlyForecast.js
index b90e9aa..abcb079 100644
--- a/src/app/hourlyForecast.js
+++ b/src/app/hourlyForecast.js
@@ -110,15 +110,9 @@ var HourlyForecastFrame = GObject.registerClass(class ForecastFrame extends Gtk.
             timeFormat = '%R';
 
         let hourEntry = new HourEntry();
-        hourEntry.timeLabel.label = datetime.format(timeFormat);
-
-        hourEntry.image.set_from_icon_name(info.get_icon_name());
-        // TODO: GTK4
-        // Use the correct enum here, GTK4 only has 2 icon "sizes"
-        hourEntry.image.set_icon_size(1);
 
         hourEntry.timeLabel.label = datetime.format(timeFormat);
-        hourEntry.image.iconName = info.get_icon_name() + '-small';
+        hourEntry.image.iconName = `${info.get_icon_name()}-small`;
         hourEntry.temperatureLabel.label = Util.getTempString(info);
 
         this._box.prepend(hourEntry);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]