[gnome-clocks] Do not use the deprecated GtlAlignment widget
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] Do not use the deprecated GtlAlignment widget
- Date: Sat, 14 Mar 2015 10:26:17 +0000 (UTC)
commit 7f60373b3b6498ef876c14d8f49b7aa4232d973e
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Mar 14 11:24:20 2015 +0100
Do not use the deprecated GtlAlignment widget
data/ui/alarmsetupdialog.ui | 24 +++++++-----------------
src/alarm.vala | 13 +++++++------
2 files changed, 14 insertions(+), 23 deletions(-)
---
diff --git a/data/ui/alarmsetupdialog.ui b/data/ui/alarmsetupdialog.ui
index 61be652..a27f926 100644
--- a/data/ui/alarmsetupdialog.ui
+++ b/data/ui/alarmsetupdialog.ui
@@ -86,19 +86,11 @@
<class name="clocks-alarm-setup-time"/>
</style>
<child>
- <object class="GtkAlignment" id="alignment1">
+ <object class="GtkLabel" id="dummy_label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="left_padding">6</property>
- <property name="right_padding">6</property>
- <child>
- <object class="GtkLabel" id="dummy_label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- </child>
+ <property name="margin_start">6</property>
+ <property name="margin_end">6</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -145,13 +137,11 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="am_pm_alignment">
+ <object class="GtkStack" id="am_pm_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <property name="left_padding">6</property>
- <property name="right_padding">6</property>
+ <property name="margin_start">6</property>
+ <property name="margin_end">6</property>
<child>
<object class="GtkLabel" id="dummy_label2">
<property name="visible">True</property>
@@ -350,7 +340,7 @@
<object class="GtkSizeGroup" id="am_pm_sizegroup">
<widgets>
<widget name="dummy_label1"/>
- <widget name="dummy_label2"/>
+ <widget name="am_pm_stack"/>
</widgets>
</object>
</interface>
diff --git a/src/alarm.vala b/src/alarm.vala
index 2ab2c60..13265e4 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -297,11 +297,9 @@ private class SetupDialog : Gtk.Dialog {
[GtkChild]
private Gtk.Box day_buttons_box;
[GtkChild]
- private Gtk.Alignment am_pm_alignment;
+ private Gtk.Stack am_pm_stack;
[GtkChild]
private Gtk.Revealer label_revealer;
- [GtkChild]
- private Gtk.SizeGroup am_pm_sizegroup;
private List<Item> alarms_list;
public SetupDialog (Gtk.Window parent, Item? alarm, List<Item> alarms) {
@@ -345,9 +343,12 @@ private class SetupDialog : Gtk.Dialog {
h_spinbutton.set_range (0, 23);
} else {
h_spinbutton.set_range (1, 12);
- am_pm_sizegroup.add_widget (am_pm_button);
- am_pm_alignment.remove (am_pm_alignment.get_child ());
- am_pm_alignment.add (am_pm_button);
+ am_pm_button.hexpand = false;
+ am_pm_button.vexpand = false;
+ am_pm_button.halign = Gtk.Align.CENTER;
+ am_pm_button.valign = Gtk.Align.CENTER;
+ am_pm_stack.add (am_pm_button);
+ am_pm_stack.visible_child = am_pm_button;
}
set_from_alarm (alarm);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]