close dialog: use "suggested-action" style class (#261)

... for the default actions (save as, save)
This commit is contained in:
NikoKrause 2018-11-15 11:10:25 +01:00 committed by Clement Lefebvre
parent 834266682c
commit 39cadaa36e
1 changed files with 8 additions and 2 deletions

View File

@ -129,6 +129,8 @@ static void
set_logout_mode (XedCloseConfirmationDialog *dlg, set_logout_mode (XedCloseConfirmationDialog *dlg,
gboolean logout_mode) gboolean logout_mode)
{ {
GtkWidget *button;
dlg->priv->logout_mode = logout_mode; dlg->priv->logout_mode = logout_mode;
if (logout_mode) if (logout_mode)
@ -159,11 +161,15 @@ set_logout_mode (XedCloseConfirmationDialog *dlg,
if (save_as) if (save_as)
{ {
gtk_dialog_add_button (GTK_DIALOG (dlg), _("_Save As..."), GTK_RESPONSE_YES); button = gtk_dialog_add_button (GTK_DIALOG (dlg), _("_Save As..."), GTK_RESPONSE_YES);
gtk_style_context_add_class (gtk_widget_get_style_context (button),
GTK_STYLE_CLASS_SUGGESTED_ACTION);
} }
else else
{ {
gtk_dialog_add_button (GTK_DIALOG (dlg), _("_Save"), GTK_RESPONSE_YES); button = gtk_dialog_add_button (GTK_DIALOG (dlg), _("_Save"), GTK_RESPONSE_YES);
gtk_style_context_add_class (gtk_widget_get_style_context (button),
GTK_STYLE_CLASS_SUGGESTED_ACTION);
} }
gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_YES); gtk_dialog_set_default_response (GTK_DIALOG (dlg), GTK_RESPONSE_YES);