[gnome-control-center] region: Embed "Restart session" button below the Language entry
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Embed "Restart session" button below the Language entry
- Date: Mon, 10 Jul 2017 13:28:33 +0000 (UTC)
commit a739ebf377e62a120b1a42cf730ca88146cce9e3
Author: Felipe Borges <felipeborges gnome org>
Date: Wed Jun 28 13:10:49 2017 +0200
region: Embed "Restart session" button below the Language entry
This change is based on the mockups available at
https://wiki.gnome.org/Design/SystemSettings/RegionAndLanguage
https://bugzilla.gnome.org/show_bug.cgi?id=702351
panels/region/cc-region-panel.c | 6 ++
panels/region/region.ui | 114 +++++++++++++++++++++++++++++---------
2 files changed, 93 insertions(+), 27 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index cafe7fc..0cf2214 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -88,6 +88,7 @@ struct _CcRegionPanelPrivate {
GtkWidget *overlay;
GtkWidget *notification;
+ GtkWidget *restart_notification;
GtkWidget *language_section;
GtkListBoxRow *language_row;
@@ -229,6 +230,7 @@ show_restart_notification (CcRegionPanel *self,
}
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification), TRUE);
+ gtk_revealer_set_reveal_child (GTK_REVEALER (priv->restart_notification), TRUE);
if (locale) {
setlocale (LC_MESSAGES, current_locale);
@@ -645,6 +647,10 @@ setup_language_section (CcRegionPanel *self)
priv->formats_row = GTK_LIST_BOX_ROW (WID ("formats_row"));
priv->formats_label = WID ("formats_label");
+ priv->restart_notification = WID ("restart-revealer");
+ widget = WID ("restart-button1");
+ g_signal_connect_swapped (widget, "clicked", G_CALLBACK (restart_now), self);
+
widget = WID ("language_list");
gtk_list_box_set_selection_mode (GTK_LIST_BOX (widget),
GTK_SELECTION_NONE);
diff --git a/panels/region/region.ui b/panels/region/region.ui
index b818eb7..556fa7d 100644
--- a/panels/region/region.ui
+++ b/panels/region/region.ui
@@ -75,40 +75,100 @@
<object class="GtkBox" id="language_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkLabel" id="language_heading">
+ <object class="GtkBox">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_start">20</property>
- <property name="margin_end">20</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Language</property>
- <property name="use_underline">True</property>
+ <child>
+ <object class="GtkLabel" id="language_heading">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_start">20</property>
+ <property name="margin_end">20</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Language</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="language_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="margin_start">20</property>
+ <property name="margin_end">20</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
+ <property name="label" translatable="yes">English (United Kingdom)</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">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</child>
<child>
- <object class="GtkLabel" id="language_label">
+ <object class="GtkRevealer" id="restart-revealer">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="margin_start">20</property>
- <property name="margin_end">20</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
- <property name="label" translatable="yes">English (United Kingdom)</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="margin_start">20</property>
+ <property name="margin_end">20</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
+ <property name="xalign">0</property>
+ <property name="hexpand">True</property>
+ <property name="wrap">True</property>
+ <property name="max-width-chars">35</property>
+ <property name="label" translatable="yes">Restart the session for
changes to take effect</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ <attributes>
+ <attribute name="scale" value="0.9"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="restart-button1">
+ <property name="visible">True</property>
+ <property name="margin_start">20</property>
+ <property name="margin_end">20</property>
+ <property name="margin_top">12</property>
+ <property name="margin_bottom">12</property>
+ <property name="valign">end</property>
+ <property name="label" translatable="yes">Restart…</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]