[gimp/gtk3-port] app: set the right "use-header-bar" on all (?) dialogs



commit ee606b20762008dd6636b0d2e6ff8b2b9de264ca
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 2 19:09:49 2018 +0200

    app: set the right "use-header-bar" on all (?) dialogs

 app/widgets/gimpcolordialog.c    |   22 ++++++++++++++--------
 app/widgets/gimperrordialog.c    |   11 +++++++++--
 app/widgets/gimpmessagedialog.c  |   16 +++++++++++-----
 app/widgets/gimpprogressdialog.c |    7 +++++++
 app/widgets/gimpspinscale.c      |    2 +-
 app/widgets/gimptexteditor.c     |   16 +++++++++++-----
 app/widgets/gimpviewabledialog.c |   24 +++++++++++++++---------
 7 files changed, 68 insertions(+), 30 deletions(-)
---
diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c
index 855003f..5e807d3 100644
--- a/app/widgets/gimpcolordialog.c
+++ b/app/widgets/gimpcolordialog.c
@@ -220,6 +220,7 @@ gimp_color_dialog_new (GimpViewable      *viewable,
 {
   GimpColorDialog *dialog;
   const gchar     *role;
+  gboolean         use_header_bar;
 
   g_return_val_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable), NULL);
   g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
@@ -232,15 +233,20 @@ gimp_color_dialog_new (GimpViewable      *viewable,
 
   role = dialog_identifier ? dialog_identifier : "gimp-color-selector";
 
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header_bar,
+                NULL);
+
   dialog = g_object_new (GIMP_TYPE_COLOR_DIALOG,
-                         "title",       title,
-                         "role",        role,
-                         "help-func",   gimp_color_dialog_help_func,
-                         "help-id",     GIMP_HELP_COLOR_DIALOG,
-                         "icon-name",   icon_name,
-                         "description", desc,
-                         "context",     context,
-                         "parent",      parent,
+                         "title",          title,
+                         "role",           role,
+                         "help-func",      gimp_color_dialog_help_func,
+                         "help-id",        GIMP_HELP_COLOR_DIALOG,
+                         "icon-name",      icon_name,
+                         "description",    desc,
+                         "context",        context,
+                         "parent",         parent,
+                         "use-header-bar", use_header_bar,
                          NULL);
 
   if (viewable)
diff --git a/app/widgets/gimperrordialog.c b/app/widgets/gimperrordialog.c
index 1e86ef0..a053de8 100644
--- a/app/widgets/gimperrordialog.c
+++ b/app/widgets/gimperrordialog.c
@@ -124,11 +124,18 @@ gimp_error_dialog_message_destroy (gpointer data)
 GtkWidget *
 gimp_error_dialog_new (const gchar *title)
 {
+  gboolean use_header_bar;
+
   g_return_val_if_fail (title != NULL, NULL);
 
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header_bar,
+                NULL);
+
   return g_object_new (GIMP_TYPE_ERROR_DIALOG,
-                       "title", title,
-                       NULL);
+                       "title",          title,
+                       "use-header-bar", use_header_bar,
+                        NULL);
 }
 
 void
diff --git a/app/widgets/gimpmessagedialog.c b/app/widgets/gimpmessagedialog.c
index 0cac65e..0c2a0ab 100644
--- a/app/widgets/gimpmessagedialog.c
+++ b/app/widgets/gimpmessagedialog.c
@@ -58,16 +58,22 @@ gimp_message_dialog_new (const gchar    *title,
 {
   GimpMessageDialog *dialog;
   va_list            args;
+  gboolean           use_header_bar;
 
   g_return_val_if_fail (title != NULL, NULL);
   g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent), NULL);
 
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header_bar,
+                NULL);
+
   dialog = g_object_new (GIMP_TYPE_MESSAGE_DIALOG,
-                         "title",     title,
-                         "role",      "gimp-message-dialog",
-                         "modal",     (flags & GTK_DIALOG_MODAL),
-                         "help-func", help_func,
-                         "help-id",   help_id,
+                         "title",          title,
+                         "role",           "gimp-message-dialog",
+                         "modal",          (flags & GTK_DIALOG_MODAL),
+                         "help-func",      help_func,
+                         "help-id",        help_id,
+                         "use-header-bar", use_header_bar,
                          NULL);
 
   if (parent)
diff --git a/app/widgets/gimpprogressdialog.c b/app/widgets/gimpprogressdialog.c
index 2dda68f..24bb5d2 100644
--- a/app/widgets/gimpprogressdialog.c
+++ b/app/widgets/gimpprogressdialog.c
@@ -219,6 +219,12 @@ gimp_progress_dialog_progress_pulse (GimpProgress *progress)
 GtkWidget *
 gimp_progress_dialog_new (void)
 {
+  gboolean use_header_bar;
+
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header_bar,
+                NULL);
+
   return g_object_new (GIMP_TYPE_PROGRESS_DIALOG,
                        "title",             _("Progress"),
                        "role",              "progress",
@@ -227,5 +233,6 @@ gimp_progress_dialog_new (void)
                        "resizable",         FALSE,
                        "focus-on-map",      FALSE,
                        "window-position",   GTK_WIN_POS_CENTER,
+                       "use-header-bar",    use_header_bar,
                        NULL);
 }
diff --git a/app/widgets/gimpspinscale.c b/app/widgets/gimpspinscale.c
index 34cafef..83ca425 100644
--- a/app/widgets/gimpspinscale.c
+++ b/app/widgets/gimpspinscale.c
@@ -150,7 +150,7 @@ gimp_spin_scale_class_init (GimpSpinScaleClass *klass)
   widget_class->get_preferred_width  = gimp_spin_scale_get_preferred_width;
   widget_class->get_preferred_height = gimp_spin_scale_get_preferred_height;
   widget_class->style_updated        = gimp_spin_scale_style_updated;
-  widget_class->draw                 = gimp_spin_scale_draw;
+  //widget_class->draw                 = gimp_spin_scale_draw;
   widget_class->button_press_event   = gimp_spin_scale_button_press;
   widget_class->button_release_event = gimp_spin_scale_button_release;
   widget_class->motion_notify_event  = gimp_spin_scale_motion_notify;
diff --git a/app/widgets/gimptexteditor.c b/app/widgets/gimptexteditor.c
index c910473..2276b9c 100644
--- a/app/widgets/gimptexteditor.c
+++ b/app/widgets/gimptexteditor.c
@@ -142,6 +142,7 @@ gimp_text_editor_new (const gchar     *title,
   GtkWidget      *toolbar;
   GtkWidget      *style_editor;
   GtkWidget      *scrolled_window;
+  gboolean        use_header_bar;
 
   g_return_val_if_fail (title != NULL, NULL);
   g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
@@ -150,12 +151,17 @@ gimp_text_editor_new (const gchar     *title,
   g_return_val_if_fail (GIMP_IS_TEXT (text), NULL);
   g_return_val_if_fail (GIMP_IS_TEXT_BUFFER (text_buffer), NULL);
 
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header_bar,
+                NULL);
+
   editor = g_object_new (GIMP_TYPE_TEXT_EDITOR,
-                         "title",         title,
-                         "role",          "gimp-text-editor",
-                         "transient-for", parent,
-                         "help-func",     gimp_standard_help_func,
-                         "help-id",       GIMP_HELP_TEXT_EDITOR_DIALOG,
+                         "title",          title,
+                         "role",           "gimp-text-editor",
+                         "transient-for",  parent,
+                         "help-func",      gimp_standard_help_func,
+                         "help-id",        GIMP_HELP_TEXT_EDITOR_DIALOG,
+                         "use-header-bar", use_header_bar,
                          NULL);
 
   gtk_dialog_add_button (GTK_DIALOG (editor),
diff --git a/app/widgets/gimpviewabledialog.c b/app/widgets/gimpviewabledialog.c
index 93d5225..f50b702 100644
--- a/app/widgets/gimpviewabledialog.c
+++ b/app/widgets/gimpviewabledialog.c
@@ -239,6 +239,7 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
 {
   GimpViewableDialog *dialog;
   va_list             args;
+  gboolean            use_header_bar;
 
   g_return_val_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable), NULL);
   g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
@@ -249,16 +250,21 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
   if (! viewable)
     g_warning ("Use of GimpViewableDialog with a NULL viewable is deprecated!");
 
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header_bar,
+                NULL);
+
   dialog = g_object_new (GIMP_TYPE_VIEWABLE_DIALOG,
-                         "viewable",    viewable,
-                         "context",     context,
-                         "title",       title,
-                         "role",        role,
-                         "help-func",   help_func,
-                         "help-id",     help_id,
-                         "icon-name",   icon_name,
-                         "description", desc,
-                         "parent",      parent,
+                         "viewable",       viewable,
+                         "context",        context,
+                         "title",          title,
+                         "role",           role,
+                         "help-func",      help_func,
+                         "help-id",        help_id,
+                         "icon-name",      icon_name,
+                         "description",    desc,
+                         "parent",         parent,
+                         "use-header-bar", use_header_bar,
                          NULL);
 
   va_start (args, help_id);


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