[gnome-control-center/wip/gbsneto/list-layout: 14/19] window: make the sidelist and first headerbar horizontally equal
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/gbsneto/list-layout: 14/19] window: make the sidelist and first headerbar horizontally equal
- Date: Thu, 26 May 2016 18:19:05 +0000 (UTC)
commit e163dced35515e9537fa8b6940754ad0d5ed5913
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun May 22 14:25:06 2016 -0300
window: make the sidelist and first headerbar horizontally equal
The first headerbar and the sidelist should stay synchronized,
and this commit does so by setting the width request of the
headerbar to the allocated width of the sidelist.
https://bugzilla.gnome.org/show_bug.cgi?id=766922
shell/cc-window.c | 10 ++++++++++
shell/window.ui | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 78a8f53..fba6613 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -887,6 +887,15 @@ stack_page_notify_cb (GtkStack *stack,
}
}
+static void
+sidelist_size_allocate_cb (GtkWidget *box,
+ GdkRectangle *allocation,
+ CcWindow *self)
+{
+ /* Keep the sidelist and the first headerbar synchronized */
+ gtk_widget_set_size_request (self->header, allocation->width, -1);
+}
+
/* CcShell implementation */
static void
_shell_embed_widget_in_header (CcShell *shell,
@@ -1184,6 +1193,7 @@ cc_window_class_init (CcWindowClass *klass)
gtk_widget_class_bind_template_callback (widget_class, gdk_window_set_cb);
gtk_widget_class_bind_template_callback (widget_class, search_entry_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, search_entry_key_press_event_cb);
+ gtk_widget_class_bind_template_callback (widget_class, sidelist_size_allocate_cb);
gtk_widget_class_bind_template_callback (widget_class, stack_page_notify_cb);
gtk_widget_class_bind_template_callback (widget_class, window_map_event_cb);
}
diff --git a/shell/window.ui b/shell/window.ui
index 0ec471a..62ce22b 100644
--- a/shell/window.ui
+++ b/shell/window.ui
@@ -16,6 +16,7 @@
<property name="can_focus">False</property>
<property name="hexpand">False</property>
<property name="orientation">vertical</property>
+ <signal name="size-allocate" handler="sidelist_size_allocate_cb" object="CcWindow" swapped="no"
/>
<child>
<object class="GtkSearchBar" id="search_bar">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]