[gnome-control-center/wip/cdavis/40-consistency: 3/5] datetime: Use libhandy preferences styling
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/cdavis/40-consistency: 3/5] datetime: Use libhandy preferences styling
- Date: Fri, 12 Feb 2021 03:14:10 +0000 (UTC)
commit ebb36bcf5fb80df7559a29bd15899466eff5bb20
Author: Christopher Davis <brainblasted disroot org>
Date: Tue Feb 9 23:06:00 2021 -0800
datetime: Use libhandy preferences styling
libhandy has nice pre-built widgetry and style classes
for preferences. We should use that where possible.
See https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1190
panels/datetime/cc-datetime-panel.c | 1 -
panels/datetime/cc-datetime-panel.ui | 259 +++++++++++++++--------------------
2 files changed, 112 insertions(+), 148 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 33a975941..6b138d13c 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -851,7 +851,6 @@ static void
setup_listbox (CcDateTimePanel *self,
GtkWidget *listbox)
{
- gtk_list_box_set_header_func (GTK_LIST_BOX (listbox), cc_list_box_update_header_func, NULL, NULL);
self->listboxes = g_list_append (self->listboxes, listbox);
self->listboxes_reverse = g_list_prepend (self->listboxes_reverse, listbox);
}
diff --git a/panels/datetime/cc-datetime-panel.ui b/panels/datetime/cc-datetime-panel.ui
index b792a263d..52efa704c 100644
--- a/panels/datetime/cc-datetime-panel.ui
+++ b/panels/datetime/cc-datetime-panel.ui
@@ -340,186 +340,151 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkScrolledWindow">
+ <object class="HdyPreferencesPage">
<property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="hscrollbar-policy">never</property>
<child>
- <object class="HdyClamp">
+ <object class="HdyPreferencesGroup">
<property name="visible">True</property>
- <property name="margin_top">32</property>
- <property name="margin_bottom">32</property>
- <property name="margin_start">12</property>
- <property name="margin_end">12</property>
-
<child>
- <object class="GtkBox">
+ <object class="GtkListBox" id="listbox2">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">32</property>
+ <property name="can_focus">True</property>
+ <property name="selection_mode">none</property>
+ <signal name="row-activated" handler="list_box_row_activated" object="CcDateTimePanel"
swapped="no"/>
+ <signal name="keynav-failed" handler="keynav_failed" object="CcDateTimePanel" swapped="no"/>
<child>
- <object class="GtkFrame" id="datetime_frame">
+ <object class="HdyActionRow" id="auto_datetime_row">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">in</property>
+ <property name="can_focus">True</property>
+ <property name="title" translatable="yes">Automatic _Date & Time</property>
+ <property name="subtitle" translatable="yes">Requires internet access</property>
+ <property name="use_underline">True</property>
<child>
- <object class="GtkListBox" id="listbox2">
+ <object class="GtkSwitch" id="network_time_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="selection_mode">none</property>
- <signal name="row-activated" handler="list_box_row_activated"
object="CcDateTimePanel" swapped="no"/>
- <signal name="keynav-failed" handler="keynav_failed" object="CcDateTimePanel"
swapped="no"/>
- <child>
- <object class="HdyActionRow" id="auto_datetime_row">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="title" translatable="yes">Automatic _Date & Time</property>
- <property name="subtitle" translatable="yes">Requires internet access</property>
- <property name="use_underline">True</property>
- <child>
- <object class="GtkSwitch" id="network_time_switch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="valign">center</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <child>
- <object class="HdyActionRow" id="datetime_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="title" translatable="yes">Date & _Time</property>
- <property name="use_underline">True</property>
- <property name="activatable">True</property>
- <child>
- <object class="GtkLabel" id="datetime_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">20 June 2012, 6:45 AM</property>
- </object>
- </child>
- </object>
- </child>
+ <property name="valign">center</property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
- <object class="GtkFrame" id="timezone_frame">
+ <object class="HdyActionRow" id="datetime_button">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">in</property>
+ <property name="can_focus">True</property>
+ <property name="title" translatable="yes">Date & _Time</property>
+ <property name="use_underline">True</property>
+ <property name="activatable">True</property>
<child>
- <object class="GtkListBox" id="listbox1">
+ <object class="GtkLabel" id="datetime_label">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="selection_mode">none</property>
- <signal name="row-activated" handler="list_box_row_activated"
object="CcDateTimePanel" swapped="no"/>
- <signal name="keynav-failed" handler="keynav_failed" object="CcDateTimePanel"
swapped="no"/>
- <child>
- <object class="HdyActionRow" id="auto_timezone_row">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="title" translatable="yes">Automatic Time _Zone</property>
- <property name="subtitle" translatable="yes">Requires location services enabled
and internet access</property>
- <property name="use_underline">True</property>
- <child>
- <object class="GtkSwitch" id="auto_timezone_switch">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="valign">center</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="HdyActionRow" id="timezone_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="title" translatable="yes">Time Z_one</property>
- <property name="use_underline">True</property>
- <property name="activatable">True</property>
- <child>
- <object class="GtkLabel" id="timezone_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="ellipsize">end</property>
- <property name="xalign">0</property>
- <property name="label">GMT+1 (London, United Kingdom)</property>
- </object>
- </child>
- </object>
- </child>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">20 June 2012, 6:45 AM</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
+ <style>
+ <class name="content"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="HdyPreferencesGroup">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkListBox" id="listbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="selection_mode">none</property>
+ <signal name="row-activated" handler="list_box_row_activated" object="CcDateTimePanel"
swapped="no"/>
+ <signal name="keynav-failed" handler="keynav_failed" object="CcDateTimePanel" swapped="no"/>
<child>
- <object class="GtkFrame" id="timeformat_frame">
+ <object class="HdyActionRow" id="auto_timezone_row">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">in</property>
+ <property name="can_focus">True</property>
+ <property name="title" translatable="yes">Automatic Time _Zone</property>
+ <property name="subtitle" translatable="yes">Requires location services enabled and
internet access</property>
+ <property name="use_underline">True</property>
<child>
- <object class="GtkListBox" id="listbox3">
+ <object class="GtkSwitch" id="auto_timezone_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="selection_mode">none</property>
- <signal name="row-activated" handler="list_box_row_activated"
object="CcDateTimePanel" swapped="no"/>
- <signal name="keynav-failed" handler="keynav_failed" object="CcDateTimePanel"
swapped="no"/>
- <child>
- <object class="HdyActionRow" id="timeformat_row">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="title" translatable="yes">Time _Format</property>
- <property name="use_underline">True</property>
- <child>
- <object class="GtkComboBoxText" id="format_combobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">center</property>
- <signal name="notify::active-id" handler="change_clock_settings"
object="CcDateTimePanel" swapped="no"/>
- <items>
- <item id="24h" translatable="yes">24-hour</item>
- <item id="12h" translatable="yes">AM / PM</item>
- </items>
- </object>
- </child>
- </object>
- </child>
+ <property name="valign">center</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="HdyActionRow" id="timezone_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="title" translatable="yes">Time Z_one</property>
+ <property name="use_underline">True</property>
+ <property name="activatable">True</property>
+ <child>
+ <object class="GtkLabel" id="timezone_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="ellipsize">end</property>
+ <property name="xalign">0</property>
+ <property name="label">GMT+1 (London, United Kingdom)</property>
</object>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
+ <style>
+ <class name="content"/>
+ </style>
</object>
</child>
- </object>
- </child>
+ </object>
+ </child>
+ <child>
+ <object class="HdyPreferencesGroup">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkListBox" id="listbox3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="selection_mode">none</property>
+ <signal name="row-activated" handler="list_box_row_activated" object="CcDateTimePanel"
swapped="no"/>
+ <signal name="keynav-failed" handler="keynav_failed" object="CcDateTimePanel" swapped="no"/>
+ <child>
+ <object class="HdyActionRow" id="timeformat_row">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="title" translatable="yes">Time _Format</property>
+ <property name="use_underline">True</property>
+ <child>
+ <object class="GtkComboBoxText" id="format_combobox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="valign">center</property>
+ <signal name="notify::active-id" handler="change_clock_settings"
object="CcDateTimePanel" swapped="no"/>
+ <items>
+ <item id="24h" translatable="yes">24-hour</item>
+ <item id="12h" translatable="yes">AM / PM</item>
+ </items>
+ </object>
+ </child>
+ </object>
+ </child>
+ <style>
+ <class name="content"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</template>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]