[gnome-weather] Drop separators on the left and right sided of the forecast stack



commit c709d17573489b6b6f8c224da512433b736c1a04
Author: Vitaly Dyachkov <obyknovenius me com>
Date:   Tue Mar 9 18:00:23 2021 +0100

    Drop separators on the left and right sided of the forecast stack

 data/weather-widget.ui | 74 ++++++++++++++++----------------------------------
 src/app/city.js        | 18 ++++++------
 2 files changed, 32 insertions(+), 60 deletions(-)
---
diff --git a/data/weather-widget.ui b/data/weather-widget.ui
index 900266e..5e46c40 100644
--- a/data/weather-widget.ui
+++ b/data/weather-widget.ui
@@ -208,74 +208,46 @@
                       </packing>
                     </child>
                     <child type="overlay">
-                      <object class="GtkBox" id="rightBox">
+                      <object class="GtkButton" id="rightButton">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
                         <property name="halign">end</property>
+                        <property name="valign">center</property>
+                        <property name="margin_end">28</property>
                         <child>
-                          <object class="GtkButton" id="rightButton">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="halign">end</property>
-                            <property name="valign">center</property>
-                            <property name="margin_end">28</property>
-                            <child>
-                              <object class="GtkImage" id="right-image">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="icon_name">go-next-symbolic</property>
-                              </object>
-                            </child>
-                            <style>
-                              <class name="osd"/>
-                              <class name="circular"/>
-                            </style>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkSeparator">
+                          <object class="GtkImage" id="right-image">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="orientation">vertical</property>
+                            <property name="icon_name">go-next-symbolic</property>
                           </object>
                         </child>
+                        <style>
+                          <class name="osd"/>
+                          <class name="circular"/>
+                        </style>
                       </object>
                     </child>
                     <child type="overlay">
-                      <object class="GtkBox" id="leftBox">
+                      <object class="GtkButton" id="leftButton">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
                         <property name="halign">start</property>
+                        <property name="valign">center</property>
+                        <property name="margin_start">28</property>
                         <child>
-                          <object class="GtkSeparator">
+                          <object class="GtkImage" id="left-image">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="orientation">vertical</property>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkButton" id="leftButton">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="halign">start</property>
-                            <property name="valign">center</property>
-                            <property name="margin_start">28</property>
-                            <child>
-                              <object class="GtkImage" id="left-image">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="icon_name">go-previous-symbolic</property>
-                                <property name="icon_size">1</property>
-                              </object>
-                            </child>
-                            <style>
-                              <class name="osd"/>
-                              <class name="circular"/>
-                            </style>
+                            <property name="icon_name">go-previous-symbolic</property>
+                            <property name="icon_size">1</property>
                           </object>
                         </child>
+                        <style>
+                          <class name="osd"/>
+                          <class name="circular"/>
+                        </style>
                       </object>
                       <packing>
                         <property name="index">1</property>
diff --git a/src/app/city.js b/src/app/city.js
index 5429c42..43e0cfe 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -39,7 +39,7 @@ var WeatherWidget = GObject.registerClass({
     InternalChildren: ['contentFrame', 'outerBox',
                        'conditionsImage', 'placesButton', 'placesLabel',
                        'temperatureLabel', 'apparentLabel',
-                       'forecastStack', 'leftBox', 'leftButton', 'rightBox', 'rightButton',
+                       'forecastStack', 'leftButton', 'rightButton',
                        'forecast-hourly', 'forecast-hourly-viewport',
                        'forecast-daily', 'forecast-daily-viewport',
                        'updatedTimeLabel', 'attributionLabel'],
@@ -125,17 +125,17 @@ var WeatherWidget = GObject.registerClass({
     _syncLeftRightButtons() {
         let hadjustment = this._forecastStack.visible_child.get_hadjustment();
         if ((hadjustment.get_upper() - hadjustment.get_lower()) == hadjustment.page_size) {
-            this._leftBox.hide();
-            this._rightBox.hide();
+            this._leftButton.hide();
+            this._rightButton.hide();
         } else if (hadjustment.value == hadjustment.get_lower()){
-            this._leftBox.hide();
-            this._rightBox.show();
+            this._leftButton.hide();
+            this._rightButton.show();
         } else if (hadjustment.value >= (hadjustment.get_upper() - hadjustment.page_size)){
-            this._leftBox.show();
-            this._rightBox.hide();
+            this._leftButton.show();
+            this._rightButton.hide();
         } else {
-            this._leftBox.show();
-            this._rightBox.show();
+            this._leftButton.show();
+            this._rightButton.show();
         }
     }
 


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