[gnome-control-center/wip/gbsneto/list-layout: 12/17] window: introduce the second headerbar



commit a6c0760d425c82c5b453ade377da9230a33ed112
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun May 22 14:18:57 2016 -0300

    window: introduce the second headerbar
    
    This commit introduces the second headerbar, where the
    panel title and the panel widgets are displayed. It also
    adapts the code to use the second headerbar when needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766922

 shell/alt/cc-window.c |    7 +++----
 shell/window.ui       |   16 ++++++++++++++++
 2 files changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/shell/alt/cc-window.c b/shell/alt/cc-window.c
index 4405b08..b4bff0c 100644
--- a/shell/alt/cc-window.c
+++ b/shell/alt/cc-window.c
@@ -42,7 +42,6 @@
 
 #define MOUSE_BACK_BUTTON 8
 
-#define DEFAULT_WINDOW_TITLE N_("All Settings")
 #define DEFAULT_WINDOW_ICON_NAME "preferences-system"
 
 #define SEARCH_PAGE "_search"
@@ -56,6 +55,7 @@ struct _CcWindow
   GtkWidget  *header;
   GtkWidget  *header_box;
   GtkWidget  *main_vbox;
+  GtkWidget  *panel_headerbar;
   GtkWidget  *search_scrolled;
   GtkWidget  *previous_button;
   GtkWidget  *top_right_box;
@@ -155,7 +155,7 @@ activate_panel (CcWindow           *self,
   icon_name = get_icon_name_from_g_icon (gicon);
 
   gtk_window_set_role (GTK_WINDOW (self), id);
-  gtk_header_bar_set_title (GTK_HEADER_BAR (self->header), name);
+  gtk_header_bar_set_title (GTK_HEADER_BAR (self->panel_headerbar), name);
   gtk_window_set_default_icon_name (icon_name);
   gtk_window_set_icon_name (GTK_WINDOW (self), icon_name);
 
@@ -223,7 +223,6 @@ shell_show_overview_page (CcWindow *self)
 
   /* reset window title and icon */
   gtk_window_set_role (GTK_WINDOW (self), NULL);
-  gtk_header_bar_set_title (GTK_HEADER_BAR (self->header), _(DEFAULT_WINDOW_TITLE));
   gtk_window_set_default_icon_name (DEFAULT_WINDOW_ICON_NAME);
   gtk_window_set_icon_name (GTK_WINDOW (self), DEFAULT_WINDOW_ICON_NAME);
 
@@ -1186,6 +1185,7 @@ cc_window_class_init (CcWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcWindow, header_sizegroup);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, lock_button);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, main_vbox);
+  gtk_widget_class_bind_template_child (widget_class, CcWindow, panel_headerbar);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, previous_button);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, search_bar);
   gtk_widget_class_bind_template_child (widget_class, CcWindow, search_button);
@@ -1307,7 +1307,6 @@ create_window (CcWindow *self)
   atk_object_set_name (accessible, _("All Settings"));
 
   gtk_window_set_titlebar (GTK_WINDOW (self), self->header_box);
-  gtk_header_bar_set_title (GTK_HEADER_BAR (self->header), _(DEFAULT_WINDOW_TITLE));
   gtk_widget_show_all (self->header_box);
 
   setup_model (self);
diff --git a/shell/window.ui b/shell/window.ui
index 55c3db6..a42390b 100644
--- a/shell/window.ui
+++ b/shell/window.ui
@@ -143,6 +143,7 @@
           <object class="GtkHeaderBar" id="header">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
+            <property name="title" translatable="yes">Settings</property>
             <child>
               <object class="GtkButton" id="previous_button">
                 <property name="visible">True</property>
@@ -181,6 +182,21 @@
                 </style>
               </object>
             </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkHeaderBar" id="panel_headerbar">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="show_close_button">True</property>
             <child>
               <object class="GtkBox" id="top_right_box">
                 <property name="visible">True</property>


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