[easytag] Set use-header-bar property on templated dialogs
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Set use-header-bar property on templated dialogs
- Date: Mon, 12 Dec 2016 17:33:11 +0000 (UTC)
commit c3eac9c29d6f126afb83522af02b3cb5ea26f772
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 d8578ea..fcb7ca3 100644
--- a/src/cddb_dialog.c
+++ b/src/cddb_dialog.c
@@ -3075,5 +3075,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 6c82c4b..5dc7ebc 100644
--- a/src/load_files_dialog.c
+++ b/src/load_files_dialog.c
@@ -1130,8 +1130,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 7abc9fa..1a63c0b 100644
--- a/src/playlist_dialog.c
+++ b/src/playlist_dialog.c
@@ -757,8 +757,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 18b2af3..ac5485a 100644
--- a/src/preferences_dialog.c
+++ b/src/preferences_dialog.c
@@ -1227,8 +1227,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]