message dialog: Allow action area to extend to the edge
https://bugzilla.gnome.org/show_bug.cgi?id=720059
This commit is contained in:
		| @ -32,6 +32,7 @@ | ||||
| #include "gtkbuildable.h" | ||||
| #include "gtklabel.h" | ||||
| #include "gtkbox.h" | ||||
| #include "gtkbbox.h" | ||||
| #include "gtkimage.h" | ||||
| #include "gtkintl.h" | ||||
| #include "gtkprivate.h" | ||||
| @ -305,6 +306,7 @@ static void | ||||
| gtk_message_dialog_init (GtkMessageDialog *dialog) | ||||
| { | ||||
|   GtkMessageDialogPrivate *priv; | ||||
|   GtkWidget *action_area; | ||||
|  | ||||
|   dialog->priv = gtk_message_dialog_get_instance_private (dialog); | ||||
|   priv = dialog->priv; | ||||
| @ -316,6 +318,10 @@ gtk_message_dialog_init (GtkMessageDialog *dialog) | ||||
|  | ||||
|   gtk_widget_init_template (GTK_WIDGET (dialog)); | ||||
|   gtk_message_dialog_style_updated (GTK_WIDGET (dialog)); | ||||
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||||
|   action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); | ||||
| G_GNUC_END_IGNORE_DEPRECATIONS | ||||
|   gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND); | ||||
| } | ||||
|  | ||||
| static void | ||||
| @ -869,6 +875,7 @@ gtk_message_dialog_add_buttons (GtkMessageDialog* message_dialog, | ||||
| { | ||||
|   GtkDialog* dialog = GTK_DIALOG (message_dialog); | ||||
|  | ||||
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||||
|   switch (buttons) | ||||
|     { | ||||
|     case GTK_BUTTONS_NONE: | ||||
| @ -876,57 +883,40 @@ gtk_message_dialog_add_buttons (GtkMessageDialog* message_dialog, | ||||
|       break; | ||||
|  | ||||
|     case GTK_BUTTONS_OK: | ||||
|       gtk_dialog_add_button (dialog, | ||||
|                              _("_OK"), | ||||
|                              GTK_RESPONSE_OK); | ||||
|       gtk_dialog_add_button (dialog, _("_OK"), GTK_RESPONSE_OK); | ||||
|       break; | ||||
|  | ||||
|     case GTK_BUTTONS_CLOSE: | ||||
|       gtk_dialog_add_button (dialog, | ||||
|                              _("_Close"), | ||||
|                              GTK_RESPONSE_CLOSE); | ||||
|       gtk_dialog_add_button (dialog, _("_Close"), GTK_RESPONSE_CLOSE); | ||||
|       break; | ||||
|  | ||||
|     case GTK_BUTTONS_CANCEL: | ||||
|       gtk_dialog_add_button (dialog, | ||||
|                              _("_Cancel"), | ||||
|                              GTK_RESPONSE_CANCEL); | ||||
|       gtk_dialog_add_button (dialog, _("_Cancel"), GTK_RESPONSE_CANCEL); | ||||
|       break; | ||||
|  | ||||
|     case GTK_BUTTONS_YES_NO: | ||||
|       gtk_dialog_add_button (dialog, | ||||
|                              _("_No"), | ||||
|                              GTK_RESPONSE_NO); | ||||
|       gtk_dialog_add_button (dialog, | ||||
|                              _("_Yes"), | ||||
|                              GTK_RESPONSE_YES); | ||||
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||||
|       gtk_dialog_add_button (dialog, _("_No"), GTK_RESPONSE_NO); | ||||
|       gtk_dialog_add_button (dialog, _("_Yes"), GTK_RESPONSE_YES); | ||||
|       gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), | ||||
| 					       GTK_RESPONSE_YES, | ||||
| 					       GTK_RESPONSE_NO, | ||||
| 					       -1); | ||||
| G_GNUC_END_IGNORE_DEPRECATIONS | ||||
|       break; | ||||
|  | ||||
|     case GTK_BUTTONS_OK_CANCEL: | ||||
|       gtk_dialog_add_button (dialog, | ||||
|                              _("_Cancel"), | ||||
|                              GTK_RESPONSE_CANCEL); | ||||
|       gtk_dialog_add_button (dialog, | ||||
|                              _("_OK"), | ||||
|                              GTK_RESPONSE_OK); | ||||
| G_GNUC_BEGIN_IGNORE_DEPRECATIONS | ||||
|       gtk_dialog_add_button (dialog, _("_Cancel"), GTK_RESPONSE_CANCEL); | ||||
|       gtk_dialog_add_button (dialog, _("_OK"), GTK_RESPONSE_OK); | ||||
|       gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog), | ||||
| 					       GTK_RESPONSE_OK, | ||||
| 					       GTK_RESPONSE_CANCEL, | ||||
| 					       -1); | ||||
| G_GNUC_END_IGNORE_DEPRECATIONS | ||||
|       break; | ||||
|        | ||||
|     default: | ||||
|       g_warning ("Unknown GtkButtonsType"); | ||||
|       break; | ||||
|     }  | ||||
| G_GNUC_END_IGNORE_DEPRECATIONS | ||||
|  | ||||
|   g_object_notify (G_OBJECT (message_dialog), "buttons"); | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Matthias Clasen
					Matthias Clasen