[gnome-terminal/wip/fmuellner/headerbar: 7/7] app: Only use headerbars on dialogues when the corresponding gtk setting is set
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal/wip/fmuellner/headerbar: 7/7] app: Only use headerbars on dialogues when the corresponding gtk setting is set
- Date: Fri, 9 Nov 2018 00:13:01 +0000 (UTC)
commit e4eb82cc7f379386cec91e43e141bb6296b5d7b9
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 cc44d8ef..14d772bc 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -1286,3 +1286,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 4030262f..33fe74ee 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 0f9c2f02..2164170a 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -910,7 +910,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]