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



commit 4267397da83cc093f5901b8b11499a66aa0f98f9
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
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756798

 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 6d39f8fc..4874267b 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -1289,3 +1289,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 934c0579..6246c305 100644
--- a/src/terminal-app.h
+++ b/src/terminal-app.h
@@ -111,6 +111,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 24d84ffc..71637b4b 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -893,7 +893,7 @@ terminal_prefs_show_preferences (GSettings *profile, const char *widget_name)
   profile_prefs_init ();
 
   /* 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]