app: add the dialog buttons after creating the GimpColorDialog instance

so the "use-header-bar" property is set when the buttons are added,
fixes the order of the "OK" and "Reset" buttons.
This commit is contained in:
Michael Natterer 2019-05-30 11:48:10 +02:00
parent e7307194cf
commit 8251406b40
1 changed files with 14 additions and 14 deletions

View File

@ -150,20 +150,6 @@ gimp_color_dialog_class_init (GimpColorDialogClass *klass)
static void
gimp_color_dialog_init (GimpColorDialog *dialog)
{
gimp_dialog_add_buttons (GIMP_DIALOG (dialog),
_("_Reset"), RESPONSE_RESET,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_OK"), GTK_RESPONSE_OK,
NULL);
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
RESPONSE_RESET,
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
dialog->stack = gtk_stack_new ();
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
dialog->stack, TRUE, TRUE, 0);
@ -467,6 +453,20 @@ gimp_color_dialog_new (GimpViewable *viewable,
"use-header-bar", use_header_bar,
NULL);
gimp_dialog_add_buttons (GIMP_DIALOG (dialog),
_("_Reset"), RESPONSE_RESET,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_OK"), GTK_RESPONSE_OK,
NULL);
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
RESPONSE_RESET,
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
if (viewable)
{
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (dialog),