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



commit 14a236c1bb3da04857ecc5f01b3064b8fa2b8a3c
Author: Evan Welsh <contact evanwelsh com>
Date:   Mon Dec 28 00:56:55 2020 -0600

    Fix icon names.

 src/app/city.js           | 3 +--
 src/app/hourlyForecast.js | 8 +-------
 2 files changed, 2 insertions(+), 9 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/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]