[gnome-control-center/gbsneto/region-redesign: 2/10] region: Move logout message to an infobar
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/region-redesign: 2/10] region: Move logout message to an infobar
- Date: Sun, 6 Feb 2022 04:03:24 +0000 (UTC)
commit 3e09a4799858b5b90220162551511edc8fc46cd8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Feb 5 12:07:48 2022 -0300
region: Move logout message to an infobar
As per mockups.
panels/region/cc-region-panel.c | 6 ++--
panels/region/cc-region-panel.ui | 77 +++++++++++++++++++---------------------
2 files changed, 39 insertions(+), 44 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 1cbf22c46..684d6964a 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -51,6 +51,7 @@ struct _CcRegionPanel {
GtkLabel *formats_label;
GtkListBox *formats_list;
GtkListBoxRow *formats_row;
+ GtkInfoBar *infobar;
GtkSizeGroup *input_size_group;
GtkLabel *login_label;
GtkLabel *language_label;
@@ -58,7 +59,6 @@ struct _CcRegionPanel {
GtkListBoxRow *language_row;
GtkToggleButton *login_language_button;
GtkButton *restart_button;
- GtkRevealer *restart_revealer;
GtkBox *session_or_login_box;
gboolean login;
@@ -164,7 +164,7 @@ set_restart_notification_visible (CcRegionPanel *self,
current_locale = uselocale (new_locale);
}
- gtk_revealer_set_reveal_child (self->restart_revealer, visible);
+ gtk_info_bar_set_revealed (self->infobar, visible);
if (locale && new_locale != (locale_t) 0) {
uselocale (current_locale);
@@ -766,13 +766,13 @@ cc_region_panel_class_init (CcRegionPanelClass * klass)
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, formats_label);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, formats_list);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, formats_row);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, infobar);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, login_label);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_label);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_list);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_row);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, login_language_button);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, restart_button);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, restart_revealer);
gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, session_or_login_box);
gtk_widget_class_bind_template_callback (widget_class, restart_now);
diff --git a/panels/region/cc-region-panel.ui b/panels/region/cc-region-panel.ui
index e8b70ce56..f3edb3bf6 100644
--- a/panels/region/cc-region-panel.ui
+++ b/panels/region/cc-region-panel.ui
@@ -6,6 +6,42 @@
<object class="GtkBox">
<property name="orientation">vertical</property>
+ <child>
+ <object class="GtkInfoBar" id="infobar">
+ <property name="revealed">False</property>
+ <property name="message-type">info</property>
+
+ <child>
+ <object class="GtkCenterBox">
+ <property name="hexpand">True</property>
+
+ <child type="center">
+ <object class="GtkLabel">
+ <property name="hexpand">True</property>
+ <property name="label" translatable="yes">Restart the session for changes to take
effect</property>
+ <style>
+ <class name="heading" />
+ </style>
+ </object>
+ </child>
+
+ <child type="end">
+ <object class="GtkButton" id="restart_button">
+ <property name="valign">center</property>
+ <property name="label" translatable="yes">Restart…</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
+ <signal name="clicked" handler="restart_now" object="CcRegionPanel" swapped="yes"/>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
+ </object>
+ </child>
+
<child>
<object class="AdwPreferencesPage">
@@ -92,47 +128,6 @@
</child>
</object>
</child>
- <child>
- <object class="GtkRevealer" id="restart_revealer">
- <property name="transition_type">slide-up</property>
- <child>
- <object class="GtkBox">
- <property name="margin_start">12</property>
- <property name="margin_end">12</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel">
- <property name="margin_bottom">8</property>
- <property name="margin_top">8</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>
- </child>
- <child>
- <object class="GtkButton" id="restart_button">
- <property name="margin_bottom">8</property>
- <property name="margin_top">8</property>
- <property name="valign">end</property>
- <property name="label" translatable="yes">Restart…</property>
- <style>
- <class name="suggested-action"/>
- </style>
- <signal name="clicked" handler="restart_now" object="CcRegionPanel"
swapped="yes"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]