[gnome-weather/wip/cdavis/use-clamp: 9/10] weather-widget: Replace outerGrid with outerBox
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather/wip/cdavis/use-clamp: 9/10] weather-widget: Replace outerGrid with outerBox
- Date: Mon, 21 Dec 2020 22:18:26 +0000 (UTC)
commit 06bfbc15b15908541175a0859d970197f1ddb4ef
Author: Christopher Davis <brainblasted disroot org>
Date: Thu Nov 26 14:09:29 2020 -0800
weather-widget: Replace outerGrid with outerBox
GtkGrid is not needed here, and is unwieldly to work with.
data/application.css | 7 --
data/weather-widget.ui | 224 +++++++++++++++++++++++--------------------------
src/app/city.js | 2 +-
3 files changed, 107 insertions(+), 126 deletions(-)
---
diff --git a/data/application.css b/data/application.css
index 2f44eee..207ced7 100644
--- a/data/application.css
+++ b/data/application.css
@@ -21,13 +21,6 @@
font-size: 1.2em;
}
-#weather-page-content-view {
- background-size: cover;
- background-position: center;
- background-origin: border-box;
- background-clip: border-box;
-}
-
#loading-label {
padding-top: 24px;
font-size: 1.5em;
diff --git a/data/weather-widget.ui b/data/weather-widget.ui
index ce02930..59665ba 100644
--- a/data/weather-widget.ui
+++ b/data/weather-widget.ui
@@ -14,118 +14,10 @@
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkGrid" id="outerGrid">
+ <object class="GtkBox" id="outerBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="vexpand">True</property>
- <child>
- <object class="GtkOverlay" id="forecast-overlay">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">24</property>
- <child>
- <object class="GtkStack" id="forecastStack">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkScrolledWindow" id="forecast-hourly">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="vscrollbar_policy">never</property>
- <property name="min_content_width">308</property>
- <child>
- <object class="GtkViewport" id="forecast-hourly-viewport">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscroll_policy">natural</property>
- <property name="vscroll_policy">natural</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="name">hourly</property>
- <property name="title" translatable="yes">Hourly</property>
- <property name="icon-name">preferences-system-time-symbolic</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="forecast-daily">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="vscrollbar_policy">never</property>
- <property name="min_content_width">308</property>
- <child>
- <object class="GtkViewport" id="forecast-daily-viewport">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscroll_policy">natural</property>
- <property name="vscroll_policy">natural</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="name">daily</property>
- <property name="title" translatable="yes">Daily</property>
- <property name="icon-name">x-office-calendar-symbolic</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="index">-1</property>
- </packing>
- </child>
- <child type="overlay">
- <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 type="overlay">
- <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>
- </object>
- <packing>
- <property name="index">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- </packing>
- </child>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkGrid" id="inner-grid">
<property name="name">conditions-grid</property>
@@ -250,10 +142,110 @@
</object>
</child>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- </packing>
+ </child>
+ <child>
+ <object class="GtkOverlay" id="forecast-overlay">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_bottom">24</property>
+ <child>
+ <object class="GtkStack" id="forecastStack">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkScrolledWindow" id="forecast-hourly">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="min_content_width">308</property>
+ <child>
+ <object class="GtkViewport" id="forecast-hourly-viewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hscroll_policy">natural</property>
+ <property name="vscroll_policy">natural</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">hourly</property>
+ <property name="title" translatable="yes">Hourly</property>
+ <property name="icon-name">preferences-system-time-symbolic</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="forecast-daily">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="vscrollbar_policy">never</property>
+ <property name="min_content_width">308</property>
+ <child>
+ <object class="GtkViewport" id="forecast-daily-viewport">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hscroll_policy">natural</property>
+ <property name="vscroll_policy">natural</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">daily</property>
+ <property name="title" translatable="yes">Daily</property>
+ <property name="icon-name">x-office-calendar-symbolic</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="index">-1</property>
+ </packing>
+ </child>
+ <child type="overlay">
+ <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 type="overlay">
+ <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>
+ </object>
+ <packing>
+ <property name="index">1</property>
+ </packing>
+ </child>
+ </object>
</child>
<child>
<object class="GtkGrid">
@@ -290,10 +282,6 @@
</packing>
</child>
</object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- </packing>
</child>
</object>
</child>
diff --git a/src/app/city.js b/src/app/city.js
index 3b7dc25..b8cde23 100644
--- a/src/app/city.js
+++ b/src/app/city.js
@@ -36,7 +36,7 @@ const UPDATED_TIME_TIMEOUT = 60; //s
var WeatherWidget = GObject.registerClass({
Template: 'resource:///org/gnome/Weather/weather-widget.ui',
- InternalChildren: ['contentFrame', 'outerGrid',
+ InternalChildren: ['contentFrame', 'outerBox',
'conditionsImage', 'placesButton', 'placesLabel',
'temperatureLabel', 'apparentLabel',
'forecastStack','leftButton', 'rightButton',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]