[gnome-weather/wind-info: 21/21] Add window information to the weather widget



commit 876b547a0257d69e2c01fe0a95f9b145c5f1906f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Oct 29 13:13:56 2018 +0000

    Add window information to the weather widget
    
    It's useful information, even if it's not provided by every GWeather
    service.
    
    Fixes #10

 data/application.css   |  6 +++++-
 data/weather-widget.ui | 36 +++++++++++++++++++++++++++++++++++-
 src/app/city.js        |  3 ++-
 3 files changed, 42 insertions(+), 3 deletions(-)
---
diff --git a/data/application.css b/data/application.css
index 6bf139b..32979d3 100644
--- a/data/application.css
+++ b/data/application.css
@@ -80,6 +80,10 @@
 
 #conditions-label {
     font-size: 2.5em;
+}
+
+#wind-label {
+    font-size: 1.5em;
     padding-bottom: 12px; /* keep in sync with conditions-image */
 }
 
@@ -106,4 +110,4 @@
 
 #locations-list-box {
     border: 1px solid @borders;
-}
\ No newline at end of file
+}
diff --git a/data/weather-widget.ui b/data/weather-widget.ui
index 88b6598..6e6940a 100644
--- a/data/weather-widget.ui
+++ b/data/weather-widget.ui
@@ -51,7 +51,7 @@
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
                         <property name="width">1</property>
-                        <property name="height">2</property>
+                        <property name="height">3</property>
                       </packing>
                     </child>
                     <child>
@@ -85,6 +85,40 @@
                         <property name="height">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkBox" id="windBox">
+                        <property name="name">wind-box</property>
+                        <property name="visible">True</property>
+                        <property name="orientation">horizontal</property>
+                        <property name="halign">start</property>
+                        <property name="valign">start</property>
+                        <property name="spacing">12</property>
+                        <child>
+                          <object class="GtkImage" id="windIcon">
+                            <property name="name">wind-icon</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="halign">start</property>
+                            <property name="icon-name">weather-windy-symbolic</property>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="windLabel">
+                            <property name="name">wind-label</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="vexpand">True</property>
+                            <property name="halign">start</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">2</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
diff --git a/src/app/city.js b/src/app/city.js
index a7e0354..dd81f98 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -36,7 +36,7 @@ var WeatherWidget = new Lang.Class({
     Extends: Gtk.Frame,
     Template: 'resource:///org/gnome/Weather/Application/weather-widget.ui',
     InternalChildren: ['contentFrame', 'outerGrid', 'conditionsImage',
-                       'temperatureLabel', 'conditionsLabel',
+                       'temperatureLabel', 'conditionsLabel', 'windLabel',
                        'timeLabel', 'timeGrid', 'forecastStack',
                        'leftButton', 'rightButton',
                        'forecast-today-grid', 'forecast-tomorrow-grid',
@@ -176,6 +176,7 @@ var WeatherWidget = new Lang.Class({
 
         this._conditionsLabel.label = Util.getWeatherConditions(info);
         this._temperatureLabel.label = info.get_temp_summary();
+        this._windLabel.label = info.get_wind();
 
         this._conditionsImage.icon_name = info.get_symbolic_icon_name();
         let context = this._contentFrame.get_style_context();


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