[gnome-control-center/wip/garnacho/wayland-tablet: 2/31] shell: Make CcWindow use custom title widget (if any)
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/garnacho/wayland-tablet: 2/31] shell: Make CcWindow use custom title widget (if any)
- Date: Fri, 24 Jun 2016 18:01:58 +0000 (UTC)
commit a13d87a315b7eb27ca50213311b43c5fd12005fe
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jun 6 13:01:37 2016 +0200
shell: Make CcWindow use custom title widget (if any)
If the current panel requests setting a custom widget, honor that
and place those in the headerbar.
shell/cc-window.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index c672f9c..f9e72c1 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -146,7 +146,7 @@ activate_panel (CcWindow *self,
const gchar *name,
GIcon *gicon)
{
- GtkWidget *box;
+ GtkWidget *box, *title_widget;
const gchar *icon_name;
if (!id)
@@ -178,6 +178,9 @@ activate_panel (CcWindow *self,
gtk_window_set_default_icon_name (icon_name);
gtk_window_set_icon_name (GTK_WINDOW (self), icon_name);
+ title_widget = cc_panel_get_title_widget (CC_PANEL (self->current_panel));
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (self->header), title_widget);
+
self->current_panel_box = box;
return TRUE;
@@ -243,6 +246,7 @@ 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_header_bar_set_custom_title (GTK_HEADER_BAR (self->header), NULL);
gtk_window_set_default_icon_name (DEFAULT_WINDOW_ICON_NAME);
gtk_window_set_icon_name (GTK_WINDOW (self), DEFAULT_WINDOW_ICON_NAME);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]