[gnome-control-center/wip/gbsneto/list-layout: 29/35] 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: 29/35] window: pack the headerbar inside a box
- Date: Fri, 3 Jun 2016 15:33:41 +0000 (UTC)
commit fa1a6b3457da2ceaf07c25dac5fd54a117c81278
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/alt/cc-window.c | 6 ++-
shell/window.ui | 91 ++++++++++++++++++++++++++-----------------------
2 files changed, 52 insertions(+), 45 deletions(-)
---
diff --git a/shell/alt/cc-window.c b/shell/alt/cc-window.c
index 9c0a5f7..4405b08 100644
--- a/shell/alt/cc-window.c
+++ b/shell/alt/cc-window.c
@@ -54,6 +54,7 @@ struct _CcWindow
GtkWidget *stack;
GtkWidget *header;
+ GtkWidget *header_box;
GtkWidget *main_vbox;
GtkWidget *search_scrolled;
GtkWidget *previous_button;
@@ -1181,6 +1182,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);
@@ -1304,9 +1306,9 @@ create_window (CcWindow *self)
accessible = gtk_widget_get_accessible (self->previous_button);
atk_object_set_name (accessible, _("All Settings"));
- 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 67697ae..55c3db6 100644
--- a/shell/window.ui
+++ b/shell/window.ui
@@ -135,67 +135,72 @@
</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="GtkButton" id="previous_button">
+ <object class="GtkHeaderBar" id="header">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
- <signal name="clicked" handler="previous_button_clicked_cb" object="CcWindow" swapped="no" />
+ <property name="can_focus">False</property>
<child>
- <object class="GtkImage">
+ <object class="GtkButton" id="previous_button">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">go-previous-symbolic</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <signal name="clicked" handler="previous_button_clicked_cb" object="CcWindow" swapped="no" />
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">go-previous-symbolic</property>
+ </object>
+ </child>
+ <style>
+ <class name="image-button"/>
+ </style>
</object>
</child>
- <style>
- <class name="image-button"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkToggleButton" id="search_button">
- <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>
<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]