[gnome-weather/wip/cdavis/diagnostics-cleanup: 4/6] Forecasts: drop GtkAlignment




commit f4a314cdcb1eb84220853c5a7c560b14b8211d5c
Author: Christopher Davis <brainblasted disroot org>
Date:   Fri Oct 23 19:48:13 2020 -0700

    Forecasts: drop GtkAlignment
    
    Use properties from GtkWidget to drop
    the use of GtkAlignment completely.
    
    Related to https://gitlab.gnome.org/GNOME/gnome-weather/-/issues/122

 data/weather-widget.ui    | 24 ------------------------
 src/app/city.js           |  6 +++---
 src/app/dailyForecast.js  |  3 +++
 src/app/hourlyForecast.js |  3 +++
 4 files changed, 9 insertions(+), 27 deletions(-)
---
diff --git a/data/weather-widget.ui b/data/weather-widget.ui
index fd00cce..168511a 100644
--- a/data/weather-widget.ui
+++ b/data/weather-widget.ui
@@ -39,18 +39,6 @@
                             <property name="can_focus">False</property>
                             <property name="hscroll_policy">natural</property>
                             <property name="vscroll_policy">natural</property>
-                            <child>
-                              <object class="GtkAlignment" id="forecast-hourly-alignment">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="halign">start</property>
-                                <property name="left_padding">20</property>
-                                <property name="right_padding">20</property>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                              </object>
-                            </child>
                           </object>
                         </child>
                       </object>
@@ -72,18 +60,6 @@
                             <property name="can_focus">False</property>
                             <property name="hscroll_policy">natural</property>
                             <property name="vscroll_policy">natural</property>
-                            <child>
-                              <object class="GtkAlignment" id="forecast-daily-alignment">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="halign">center</property>
-                                <property name="left_padding">20</property>
-                                <property name="right_padding">20</property>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                              </object>
-                            </child>
                           </object>
                         </child>
                       </object>
diff --git a/src/app/city.js b/src/app/city.js
index a821604..f989e83 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -143,8 +143,8 @@ var WeatherWidget = GObject.registerClass({
                        'placesButton', 'placesLabel',
                        'temperatureLabel', 'apparentLabel',
                        'forecastStack','leftButton', 'rightButton',
-                       'forecast-hourly', 'forecast-hourly-alignment',
-                       'forecast-daily', 'forecast-daily-alignment',
+                       'forecast-hourly', 'forecast-hourly-viewport',
+                       'forecast-daily', 'forecast-daily-viewport',
                        'updatedTimeLabel', 'attributionLabel'],
 }, class WeatherWidget extends Gtk.Frame {
 
@@ -172,7 +172,7 @@ var WeatherWidget = GObject.registerClass({
             }
 
             this._forecasts[t] = box;
-            this['_forecast_' + t + '_alignment'].add(box);
+            this['_forecast_' + t + '_viewport'].add(box);
 
             let fsw = this['_forecast_' + t];
             let hscrollbar = fsw.get_hscrollbar();
diff --git a/src/app/dailyForecast.js b/src/app/dailyForecast.js
index 8b9cc6d..1bf4230 100644
--- a/src/app/dailyForecast.js
+++ b/src/app/dailyForecast.js
@@ -27,6 +27,9 @@ var DailyForecastFrame = GObject.registerClass(class DailyForecastFrame extends
 
     _init(params) {
         super._init(Object.assign({
+            halign: Gtk.Align.START,
+            margin_start: 20,
+            margin_end: 20,
             shadow_type: Gtk.ShadowType.IN,
             name: 'daily-forecast-frame',
         }, params));
diff --git a/src/app/hourlyForecast.js b/src/app/hourlyForecast.js
index c94d428..ee63ad3 100644
--- a/src/app/hourlyForecast.js
+++ b/src/app/hourlyForecast.js
@@ -32,6 +32,9 @@ var HourlyForecastFrame = GObject.registerClass(class ForecastFrame extends Gtk.
 
     _init(params) {
         super._init(Object.assign({
+            halign: Gtk.Align.START,
+            margin_start: 20,
+            margin_end: 20,
             shadow_type: Gtk.ShadowType.IN,
             name: 'hourly-forecast-frame',
         }, params));


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