[gnome-weather] Use colored icons
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] Use colored icons
- Date: Sat, 7 Nov 2020 19:33:00 +0000 (UTC)
commit f17ce28eca3129d752839fa734ff90f3fd862658
Author: Vitaly Dyachkov <obyknovenius me com>
Date: Thu Oct 29 17:41:31 2020 +0100
Use colored icons
src/app/city.js | 4 ++++
src/app/dailyForecast.js | 4 +++-
src/app/hourlyForecast.js | 6 +++++-
3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/app/city.js b/src/app/city.js
index 2abf4d9..e37d656 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -304,6 +304,10 @@ var WeatherWidget = GObject.registerClass({
this._worldView.refilter();
+ const iconTheme = Gtk.IconTheme.get_default();
+ const icon = iconTheme.load_icon(info.get_icon_name(), 84, 0);
+ this._conditionsImage.set_from_pixbuf(icon);
+
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 1bf4230..c400782 100644
--- a/src/app/dailyForecast.js
+++ b/src/app/dailyForecast.js
@@ -180,7 +180,9 @@ var DailyForecastFrame = GObject.registerClass(class DailyForecastFrame extends
let dateFormat = _('%e %b');
dayEntry.dateLabel.label = day.format(dateFormat);
- dayEntry.image.iconName = dayInfo.get_symbolic_icon_name();
+ const iconTheme = Gtk.IconTheme.get_default();
+ const icon = iconTheme.load_icon(dayInfo.get_icon_name() + '-small', 32, 0);
+ dayEntry.image.set_from_pixbuf(icon);
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 ee63ad3..5c3d2d5 100644
--- a/src/app/hourlyForecast.js
+++ b/src/app/hourlyForecast.js
@@ -112,7 +112,11 @@ var HourlyForecastFrame = GObject.registerClass(class ForecastFrame extends Gtk.
let hourEntry = new HourEntry();
hourEntry.timeLabel.label = datetime.format(timeFormat);
- hourEntry.image.iconName = info.get_symbolic_icon_name();
+
+ const iconTheme = Gtk.IconTheme.get_default();
+ const icon = iconTheme.load_icon(info.get_icon_name() + '-small', 32, 0);
+ hourEntry.image.set_from_pixbuf(icon);
+
hourEntry.temperatureLabel.label = Util.getTempString(info);
this._box.pack_start(hourEntry, false, false, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]