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
This commit is contained in:
Felipe Borges 2017-06-28 13:10:49 +02:00
parent 658b5d5033
commit a739ebf377
2 changed files with 93 additions and 27 deletions

View file

@ -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);

View file

@ -75,6 +75,10 @@
<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="GtkBox">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="language_heading">
<property name="visible">True</property>
@ -112,6 +116,62 @@
</child>
</object>
</child>
<child>
<object class="GtkRevealer" id="restart-revealer">
<property name="visible">True</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>
</child>
</object>
</child>
</object>
</child>
<child>