[gnome-terminal/wip/headerbar: 10/10] app: Only use headerbars on dialogues when the corresponding gtk setting is set



commit 6a07e570a0aa58eb7ee9e0b9df50964623adff76
Author: Christian Persch <chpe src gnome org>
Date:   Tue Nov 6 20:10:13 2018 +0100

    app: Only use headerbars on dialogues when the corresponding gtk setting is set

 src/terminal-app.c            | 13 +++++++++++++
 src/terminal-app.h            |  2 ++
 src/terminal-prefs.c          |  2 +-
 src/terminal-search-popover.c |  2 +-
 4 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/terminal-app.c b/src/terminal-app.c
index fff0c412..bb205319 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -1244,3 +1244,16 @@ terminal_app_get_use_headerbar (TerminalApp *app)
 
   return app->use_headerbar;
 }
+
+gboolean
+terminal_app_get_dialog_use_headerbar (TerminalApp *app)
+{
+  g_return_val_if_fail (TERMINAL_IS_APP (app), FALSE);
+
+  gboolean dialog_use_header;
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &dialog_use_header,
+                NULL);
+
+  return dialog_use_header && app->use_headerbar;
+}
diff --git a/src/terminal-app.h b/src/terminal-app.h
index 4e354e85..c34d8fac 100644
--- a/src/terminal-app.h
+++ b/src/terminal-app.h
@@ -109,6 +109,8 @@ gboolean terminal_app_get_menu_unified (TerminalApp *app);
 
 gboolean terminal_app_get_use_headerbar (TerminalApp *app);
 
+gboolean terminal_app_get_dialog_use_headerbar (TerminalApp *app);
+
 /* GSettings */
 
 GSettings *terminal_app_get_global_settings (TerminalApp *app);
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.c
index e952ddec..4dd17c05 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -909,7 +909,7 @@ done:
   }
 
   /* Move action widgets to titlebar when headerbar is used */
-  if (terminal_app_get_use_headerbar (app)) {
+  if (terminal_app_get_dialog_use_headerbar (app)) {
     GtkWidget *headerbar;
     GtkWidget *bbox;
 
diff --git a/src/terminal-search-popover.c b/src/terminal-search-popover.c
index bb298c48..5369727b 100644
--- a/src/terminal-search-popover.c
+++ b/src/terminal-search-popover.c
@@ -413,7 +413,7 @@ terminal_search_popover_init (TerminalSearchPopover *popover)
 
   g_signal_connect (popover, "key-press-event", G_CALLBACK (key_press_cb), NULL);
 
-  if (terminal_app_get_use_headerbar (terminal_app_get ())) {
+  if (terminal_app_get_dialog_use_headerbar (terminal_app_get ())) {
     GtkWidget *headerbar;
 
     headerbar = g_object_new (GTK_TYPE_HEADER_BAR,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]