GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit b2dd892e authored by Michael Natterer's avatar Michael Natterer 😴

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

parent 83b97aff
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
......@@ -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);
}
......@@ -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),
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment