[easytag/wip/future-gtk: 28/28] Set use-header-bar property on templated dialogs



commit ded03ce7cfa5ad174316021b22de24788a02432b
Author: David King <amigadave amigadave com>
Date:   Thu May 14 00:51:22 2015 +0700

    Set use-header-bar property on templated dialogs
    
    The non-templated dialogs must have the property set during
    construction.

 src/cddb_dialog.c        |   14 +++++++++++++-
 src/load_files_dialog.c  |   13 ++++++++++++-
 src/playlist_dialog.c    |   13 ++++++++++++-
 src/preferences_dialog.c |   13 ++++++++++++-
 4 files changed, 49 insertions(+), 4 deletions(-)
---
diff --git a/src/cddb_dialog.c b/src/cddb_dialog.c
index c9f9660..12d13f0 100644
--- a/src/cddb_dialog.c
+++ b/src/cddb_dialog.c
@@ -3739,5 +3739,17 @@ et_cddb_dialog_class_init (EtCDDBDialogClass *klass)
 EtCDDBDialog *
 et_cddb_dialog_new (void)
 {
-    return g_object_new (ET_TYPE_CDDB_DIALOG, NULL);
+    GtkSettings *settings;
+    gboolean use_header_bar = FALSE;
+
+    settings = gtk_settings_get_default ();
+
+    if (settings)
+    {
+        g_object_get (settings, "gtk-dialogs-use-header", &use_header_bar,
+                      NULL);
+    }
+
+    return g_object_new (ET_TYPE_CDDB_DIALOG, "use-header-bar", use_header_bar,
+                         NULL);
 }
diff --git a/src/load_files_dialog.c b/src/load_files_dialog.c
index f72d6e9..32c9605 100644
--- a/src/load_files_dialog.c
+++ b/src/load_files_dialog.c
@@ -1121,8 +1121,19 @@ et_load_files_dialog_class_init (EtLoadFilesDialogClass *klass)
 EtLoadFilesDialog *
 et_load_files_dialog_new (GtkWindow *parent)
 {
+    GtkSettings *settings;
+    gboolean use_header_bar = FALSE;
+
     g_return_val_if_fail (GTK_WINDOW (parent), NULL);
 
+    settings = gtk_settings_get_default ();
+
+    if (settings)
+    {
+        g_object_get (settings, "gtk-dialogs-use-header", &use_header_bar,
+                      NULL);
+    }
+
     return g_object_new (ET_TYPE_LOAD_FILES_DIALOG, "transient-for", parent,
-                         NULL);
+                         "use-header-bar", use_header_bar, NULL);
 }
diff --git a/src/playlist_dialog.c b/src/playlist_dialog.c
index a0bcb40..37c3389 100644
--- a/src/playlist_dialog.c
+++ b/src/playlist_dialog.c
@@ -771,8 +771,19 @@ et_playlist_dialog_class_init (EtPlaylistDialogClass *klass)
 EtPlaylistDialog *
 et_playlist_dialog_new (GtkWindow *parent)
 {
+    GtkSettings *settings;
+    gboolean use_header_bar = FALSE;
+
     g_return_val_if_fail (GTK_WINDOW (parent), NULL);
 
+    settings = gtk_settings_get_default ();
+
+    if (settings)
+    {
+        g_object_get (settings, "gtk-dialogs-use-header", &use_header_bar,
+                      NULL);
+    }
+
     return g_object_new (ET_TYPE_PLAYLIST_DIALOG, "transient-for", parent,
-                         NULL);
+                         "use-header-bar", use_header_bar, NULL);
 }
diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c
index 45610f2..2137a99 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -1270,8 +1270,19 @@ et_preferences_dialog_class_init (EtPreferencesDialogClass *klass)
 EtPreferencesDialog *
 et_preferences_dialog_new (GtkWindow *parent)
 {
+    GtkSettings *settings;
+    gboolean use_header_bar = FALSE;
+
     g_return_val_if_fail (GTK_WINDOW (parent), NULL);
 
+    settings = gtk_settings_get_default ();
+
+    if (settings)
+    {
+        g_object_get (settings, "gtk-dialogs-use-header", &use_header_bar,
+                      NULL);
+    }
+
     return g_object_new (ET_TYPE_PREFERENCES_DIALOG, "transient-for", parent,
-                         NULL);
+                         "use-header-bar", use_header_bar, NULL);
 }


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