[gnome-control-center] region: Avoid resizing when showing the logout button



commit 188329a0bed51263a6e478315f4dfaa83374e32d
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Nov 23 19:05:24 2012 +0100

    region: Avoid resizing when showing the logout button

 panels/region/gnome-region-panel-lang.c |   11 ++++---
 panels/region/gnome-region-panel.ui     |   51 ++++++++++++++++++++++++++++--
 2 files changed, 53 insertions(+), 9 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-lang.c b/panels/region/gnome-region-panel-lang.c
index cd33dc5..f34ff07 100644
--- a/panels/region/gnome-region-panel-lang.c
+++ b/panels/region/gnome-region-panel-lang.c
@@ -102,23 +102,24 @@ static void
 update_logout_button (GtkBuilder *builder,
 		      const char *locale)
 {
-	GtkWidget *widget;
+	GtkWidget *button, *notebook;
 	char *old_lang;
 
 	/* Offer log out in the new language, unless it is
 	 * the original session language */
-	widget = (GtkWidget *)gtk_builder_get_object (builder, "logout_button");
+	button = (GtkWidget *)gtk_builder_get_object (builder, "logout_button");
+	notebook = (GtkWidget *)gtk_builder_get_object (builder, "logout_notebook");
 
 	if (is_old_locale (locale) == FALSE) {
 		old_lang = g_strdup (setlocale (LC_MESSAGES, NULL));
 		setlocale (LC_MESSAGES, locale);
-		gtk_button_set_label (GTK_BUTTON (widget), _("Log out for changes to take effect"));
+		gtk_button_set_label (GTK_BUTTON (button), _("Log out for changes to take effect"));
 		setlocale (LC_MESSAGES, old_lang);
 		g_free (old_lang);
 
-		gtk_widget_show (widget);
+		gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
 	} else {
-		gtk_widget_hide (widget);
+		gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0);
 	}
 }
 
diff --git a/panels/region/gnome-region-panel.ui b/panels/region/gnome-region-panel.ui
index 9cb576f..573094c 100644
--- a/panels/region/gnome-region-panel.ui
+++ b/panels/region/gnome-region-panel.ui
@@ -129,11 +129,54 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkButton" id="logout_button">
-                            <property name="label" translatable="yes">Log out for changes to take effect</property>
-                            <property name="visible">False</property>
+                          <object class="GtkNotebook" id="logout_notebook">
+                            <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
+                            <property name="show_tabs">False</property>
+                            <child>
+                              <object class="GtkLabel" id="empty_label">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                              </object>
+                            </child>
+                            <child type="tab">
+                              <object class="GtkLabel" id="label2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">page 1</property>
+                              </object>
+                              <packing>
+                                <property name="tab_fill">False</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="logout_button">
+                                <property name="label" translatable="yes">Log out for changes to take effect</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                              </object>
+                              <packing>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                            <child type="tab">
+                              <object class="GtkLabel" id="label22">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">page 2</property>
+                              </object>
+                              <packing>
+                                <property name="position">1</property>
+                                <property name="tab_fill">False</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child type="tab">
+                              <placeholder/>
+                            </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]