[gnome-terminal/wip/fmuellner/headerbar] search-popover: Set titlebar when headerbars are used
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal/wip/fmuellner/headerbar] search-popover: Set titlebar when headerbars are used
- Date: Sun, 4 Nov 2018 14:33:19 +0000 (UTC)
commit d8f76920b87af79440d86e9ea3c36b568bddbfc1
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Nov 4 15:01:56 2018 +0100
search-popover: Set titlebar when headerbars are used
While there aren't any controls that make sense to move into the
titlebar, client- and server-side decorations are likely only
consistent under GNOME. So to ensure that all the app's windows
are consistent with each other, set up a default titlebar when
headerbars should be used.
https://bugzilla.gnome.org/show_bug.cgi?id=756798
src/terminal-search-popover.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/src/terminal-search-popover.c b/src/terminal-search-popover.c
index 8d814cf4..4cd6ce45 100644
--- a/src/terminal-search-popover.c
+++ b/src/terminal-search-popover.c
@@ -384,7 +384,23 @@ terminal_search_popover_init (TerminalSearchPopover *popover)
gtk_popover_set_default_widget (GTK_POPOVER (popover), priv->search_prev_button);
G_GNUC_END_IGNORE_DEPRECATIONS
#else
- gtk_window_set_default (GTK_WINDOW (popover), priv->search_prev_button);
+ GtkWindow *window = GTK_WINDOW (popover);
+ gtk_window_set_default (window, priv->search_prev_button);
+
+ if (terminal_app_get_use_headerbar (terminal_app_get ()))
+ {
+ GtkWidget *headerbar;
+
+ headerbar = g_object_new (GTK_TYPE_HEADER_BAR,
+ "title", gtk_window_get_title (window),
+ "has-subtitle", FALSE,
+ "show-close-button", TRUE,
+ "visible", TRUE,
+ NULL);
+ gtk_style_context_add_class (gtk_widget_get_style_context (headerbar),
+ "default-decoration");
+ gtk_window_set_titlebar (window, headerbar);
+ }
#endif
#if GTK_CHECK_VERSION (3, 16, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]