[gnome-control-center/wip/gbsneto/list-layout: 12/19] window: pack the headerbar inside a box
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/gbsneto/list-layout: 12/19] window: pack the headerbar inside a box
- Date: Thu, 26 May 2016 18:18:55 +0000 (UTC)
commit 6e2dbced8670793cc40e0271553d4b9bb8729b25
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun May 22 14:11:31 2016 -0300
window: pack the headerbar inside a box
In the future commits, we'll use two headerbars to visually
separate the panel area and the sidelist.
https://bugzilla.gnome.org/show_bug.cgi?id=766922
shell/cc-window.c | 6 +++-
shell/window.ui | 61 ++++++++++++++++++++++++++++------------------------
2 files changed, 37 insertions(+), 30 deletions(-)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 919c483..cbe4944 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -54,6 +54,7 @@ struct _CcWindow
GtkWidget *stack;
GtkWidget *header;
+ GtkWidget *header_box;
GtkWidget *main_vbox;
GtkWidget *search_scrolled;
GtkWidget *top_right_box;
@@ -1170,6 +1171,7 @@ cc_window_class_init (CcWindowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/ControlCenter/gtk/window.ui");
gtk_widget_class_bind_template_child (widget_class, CcWindow, header);
+ gtk_widget_class_bind_template_child (widget_class, CcWindow, header_box);
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);
@@ -1285,9 +1287,9 @@ create_search_page (CcWindow *self)
static void
create_window (CcWindow *self)
{
- gtk_window_set_titlebar (GTK_WINDOW (self), self->header);
+ 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);
+ gtk_widget_show_all (self->header_box);
setup_model (self);
create_search_page (self);
diff --git a/shell/window.ui b/shell/window.ui
index 81b046a..3d566ff 100644
--- a/shell/window.ui
+++ b/shell/window.ui
@@ -135,48 +135,53 @@
</object>
</child>
<child type="titlebar">
- <object class="GtkHeaderBar" id="header">
+ <object class="GtkBox" id="header_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="show_close_button">True</property>
+ <property name="orientation">horizontal</property>
<child>
- <object class="GtkToggleButton" id="search_button">
+ <object class="GtkHeaderBar" id="header">
<property name="visible">True</property>
- <property name="active" bind-source="search_bar" bind-property="search-mode-enabled"
bind-flags="bidirectional" />
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
+ <property name="can_focus">False</property>
<child>
- <object class="GtkImage">
+ <object class="GtkToggleButton" id="search_button">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">edit-find-symbolic</property>
+ <property name="active" bind-source="search_bar" bind-property="search-mode-enabled"
bind-flags="bidirectional" />
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">edit-find-symbolic</property>
+ </object>
+ </child>
+ <style>
+ <class name="image-button"/>
+ </style>
</object>
</child>
- <style>
- <class name="image-button"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkBox" id="top_right_box">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
<child>
- <object class="GtkLockButton" id="lock_button">
+ <object class="GtkBox" id="top_right_box">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="no_show_all">True</property>
- <style>
- <class name="text-button" />
- </style>
+ <child>
+ <object class="GtkLockButton" id="lock_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="no_show_all">True</property>
+ <style>
+ <class name="text-button" />
+ </style>
+ </object>
+ </child>
</object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
</child>
</object>
- <packing>
- <property name="pack_type">end</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]