[gnome-weather/wip/cdavis/daily-style-adjustments: 1/3] dailyForecast: Adjust popovers
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather/wip/cdavis/daily-style-adjustments: 1/3] dailyForecast: Adjust popovers
- Date: Thu, 26 Nov 2020 18:50:25 +0000 (UTC)
commit 222e5469c1e2d3e5c4f53f211a5747f11833694c
Author: Christopher Davis <brainblasted disroot org>
Date: Wed Nov 25 20:12:53 2020 -0800
dailyForecast: Adjust popovers
Adjust popover styling. Related to https://gitlab.gnome.org/GNOME/gnome-weather/-/issues/103
Fixes:
* Columns are too wide
* Incorrect icons for columns
* Wind shouldn't include direction
data/application.css | 4 ++
data/day-entry.ui | 7 ++-
.../scalable/status/temperature-symbolic.svg | 56 ++++++++++++++++++++++
org.gnome.Weather.json | 3 +-
src/app/dailyForecast.js | 19 ++++++--
5 files changed, 82 insertions(+), 7 deletions(-)
---
diff --git a/data/application.css b/data/application.css
index 2aa0265..444e7c6 100644
--- a/data/application.css
+++ b/data/application.css
@@ -99,3 +99,7 @@ button.osd.circular {
button.osd.circular > image {
padding: 12px;
}
+
+.day-popover {
+ background-color: @theme_base_color;
+}
diff --git a/data/day-entry.ui b/data/day-entry.ui
index ce22469..920bfb5 100644
--- a/data/day-entry.ui
+++ b/data/day-entry.ui
@@ -4,6 +4,9 @@
<requires lib="gtk+" version="3.20"/>
<object class="GtkPopoverMenu" id="more_menu">
<property name="can_focus">False</property>
+ <style>
+ <class name="day-popover"/>
+ </style>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
@@ -163,7 +166,7 @@
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="icon_name">weather-windy</property>
+ <property name="icon_name">temperature-symbolic</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -174,7 +177,7 @@
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="icon_name">weather-windy</property>
+ <property name="icon_name">weather-showers-scattered-symbolic</property>
</object>
<packing>
<property name="left_attach">1</property>
diff --git a/data/icons/hicolor/scalable/status/temperature-symbolic.svg
b/data/icons/hicolor/scalable/status/temperature-symbolic.svg
new file mode 100644
index 0000000..80c4312
--- /dev/null
+++ b/data/icons/hicolor/scalable/status/temperature-symbolic.svg
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16px"
+ height="16px"
+ viewBox="0 0 16 16"
+ version="1.1"
+ id="svg3812"
+ sodipodi:docname="temperature-symbolic.svg"
+ inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
+ <metadata
+ id="metadata3818">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs3816" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="2560"
+ inkscape:window-height="1376"
+ id="namedview3814"
+ showgrid="false"
+ inkscape:zoom="7.875"
+ inkscape:cx="7.0950318"
+ inkscape:cy="4.2683798"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg3812" />
+ <path
+ sodipodi:nodetypes="sscssscsssscssscssccsssccc"
+ inkscape:connector-curvature="0"
+ id="path31532"
+ d="m 8.0000001,-7e-8 c -1.662,0 -3,1.33800007 -3,3.00000007 v 6.375 c -0.615,0.703 -1,1.6134 -1,2.625
0,2.216 1.784,4 4,4 C 10.216,16 12,14.216 12,12 12,10.9884 11.615,10.078 11,9.375 V 3 C 11,1.338
9.6620001,-7e-8 8.0000001,-7e-8 Z m 0,1 C 9.1080001,0.99999993 9.9999999,1.8921 9.9999999,3 V 9.7754 C
10.6101,10.3238 11,11.1113 11,12 c 0,1.662 -1.3379999,3 -2.9999999,3 -1.662,0 -3,-1.338 -3,-3 0,-0.8887
0.3899,-1.6762 1,-2.2246 V 3 c 0,-1.1079 0.892,-2.00000007 2,-2.00000007 z M 7.0000001,5 v 5.2754 c
-0.5958,0.3456 -1,0.9836 -1,1.7246 0,1.108 0.892,2 2,2 1.108,0 1.9999998,-0.892 1.9999998,-2 0,-0.741
-0.4041998,-1.379 -0.9999998,-1.7246 V 5 Z"
+
style="opacity:1;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
/>
+</svg>
diff --git a/org.gnome.Weather.json b/org.gnome.Weather.json
index a1899fc..632fad9 100644
--- a/org.gnome.Weather.json
+++ b/org.gnome.Weather.json
@@ -53,7 +53,8 @@
"sources" : [
{
"type" : "git",
- "url" : "https://gitlab.gnome.org/GNOME/libgweather.git"
+ "url" : "https://gitlab.gnome.org/GNOME/libgweather.git",
+ "branch" : "wip/cdavis/windspeed-string"
}
]
},
diff --git a/src/app/dailyForecast.js b/src/app/dailyForecast.js
index 6b8cbd4..3fd67a9 100644
--- a/src/app/dailyForecast.js
+++ b/src/app/dailyForecast.js
@@ -20,6 +20,7 @@ const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
+const GWeather = imports.gi.GWeather;
const Util = imports.misc.util;
@@ -188,22 +189,22 @@ var DailyForecastFrame = GObject.registerClass(class DailyForecastFrame extends
dayEntry.nightTemperatureLabel.label = Util.getTempString(nightInfo);
dayEntry.nightImage.iconName = nightInfo.get_icon_name() + '-small';
dayEntry.nightHumidity.label = nightInfo.get_humidity();
- dayEntry.nightWind.label = nightInfo.get_wind();
+ this._setWindInfo(nightInfo, dayEntry.nightWind);
dayEntry.morningTemperatureLabel.label = Util.getTempString(morningInfo);
dayEntry.morningImage.iconName = morningInfo.get_icon_name() + '-small';
dayEntry.morningHumidity.label = morningInfo.get_humidity();
- dayEntry.morningWind.label = morningInfo.get_wind();
+ this._setWindInfo(morningInfo, dayEntry.morningWind);
dayEntry.afternoonTemperatureLabel.label = Util.getTempString(afternoonInfo);
dayEntry.afternoonImage.iconName = afternoonInfo.get_icon_name() + '-small';
dayEntry.afternoonHumidity.label = afternoonInfo.get_humidity();
- dayEntry.afternoonWind.label = afternoonInfo.get_wind();
+ this._setWindInfo(afternoonInfo, dayEntry.afternoonWind);
dayEntry.eveningTemperatureLabel.label = Util.getTempString(eveningInfo);
dayEntry.eveningImage.iconName = eveningInfo.get_icon_name() + '-small';
dayEntry.eveningHumidity.label = eveningInfo.get_humidity();
- dayEntry.eveningWind.label = eveningInfo.get_wind();
+ this._setWindInfo(eveningInfo, dayEntry.eveningWind);
this._box.pack_start(dayEntry, false, false, 0);
}
@@ -214,6 +215,16 @@ var DailyForecastFrame = GObject.registerClass(class DailyForecastFrame extends
this._box.pack_start(separator, false, false, 0);
}
+ _setWindInfo(info, label) {
+ let [ok, speed, direction] = info.get_value_wind(GWeather.SpeedUnit.DEFAULT);
+ if (ok) {
+ label.label = speed.toFixed(1).toString() + ' ' +
GWeather.speed_unit_to_string(GWeather.SpeedUnit.DEFAULT);
+ } else {
+ /* Fall back to get_wind() */
+ label.label = info.get_wind();
+ }
+ }
+
clear() {
this._box.foreach(function(w) { w.destroy(); });
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]