[gnome-weather/wip/cdavis/diagnostics-cleanup: 2/6] hour-entry: Subclass GtkBox instead of GtkAlignment
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather/wip/cdavis/diagnostics-cleanup: 2/6] hour-entry: Subclass GtkBox instead of GtkAlignment
- Date: Sat, 24 Oct 2020 03:10:40 +0000 (UTC)
commit b4655b125af2f82f028ebef4a646ed9a640ecaa6
Author: Christopher Davis <brainblasted disroot org>
Date: Fri Oct 23 19:16:28 2020 -0700
hour-entry: Subclass GtkBox instead of GtkAlignment
GtkAlignment is dead in GTK4, and all of it's
uses are replaced by other APIs in 3.
Related to https://gitlab.gnome.org/GNOME/gnome-weather/-/issues/122
data/hour-entry.ui | 98 ++++++++++++++++++++++-------------------------
src/app/hourlyForecast.js | 2 +-
2 files changed, 47 insertions(+), 53 deletions(-)
---
diff --git a/data/hour-entry.ui b/data/hour-entry.ui
index cffb6bb..a8821d8 100644
--- a/data/hour-entry.ui
+++ b/data/hour-entry.ui
@@ -2,65 +2,59 @@
<!-- Generated with glade 3.22.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
- <template class="Gjs_HourEntry" parent="GtkAlignment">
+ <template class="Gjs_HourEntry" parent="GtkBox">
+ <property name="width_request">75</property>
+ <property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="top_padding">18</property>
- <property name="bottom_padding">18</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">18</property>
+ <property name="margin_top">18</property>
+ <property name="margin_bottom">18</property>
<child>
- <object class="GtkBox" id="box">
- <property name="width_request">75</property>
- <property name="height_request">200</property>
+ <object class="GtkLabel" id="timeLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
+ <property name="label">Now</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkImage" id="image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">start</property>
<property name="vexpand">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">18</property>
- <child>
- <object class="GtkLabel" id="timeLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">Now</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">start</property>
- <property name="vexpand">True</property>
- <property name="pixel_size">32</property>
- <property name="icon_name">weather-showers-symbolic</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="temperatureLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">end</property>
- <property name="label">13°</property>
- <style>
- <class name="forecast-temperature-label"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
+ <property name="pixel_size">32</property>
+ <property name="icon_name">weather-showers-symbolic</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="temperatureLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">end</property>
+ <property name="label">13°</property>
+ <style>
+ <class name="forecast-temperature-label"/>
+ </style>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</template>
</interface>
diff --git a/src/app/hourlyForecast.js b/src/app/hourlyForecast.js
index f7d6f3d..c94d428 100644
--- a/src/app/hourlyForecast.js
+++ b/src/app/hourlyForecast.js
@@ -219,7 +219,7 @@ var HourlyForecastFrame = GObject.registerClass(class ForecastFrame extends Gtk.
var HourEntry = GObject.registerClass({
Template: 'resource:///org/gnome/Weather/hour-entry.ui',
InternalChildren: ['timeLabel', 'image', 'temperatureLabel'],
-}, class HourEntry extends Gtk.Alignment {
+}, class HourEntry extends Gtk.Box {
_init(params) {
super._init(params);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]