[tepl] close-confirm-dialog-single: better buttons styling



commit fe0ab4b82841d7d071120afbb3cae3e8da57373a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun May 24 18:57:18 2020 +0200

    close-confirm-dialog-single: better buttons styling

 tepl/tepl-close-confirm-dialog-single.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/tepl/tepl-close-confirm-dialog-single.c b/tepl/tepl-close-confirm-dialog-single.c
index 9c6e18b..e656291 100644
--- a/tepl/tepl-close-confirm-dialog-single.c
+++ b/tepl/tepl-close-confirm-dialog-single.c
@@ -102,6 +102,7 @@ create_dialog (GTask *task)
        GFile *location;
        gchar *file_short_name;
        GtkWidget *dialog;
+       GtkWidget *close_button;
 
        tab = g_task_get_source_object (task);
        buffer = tepl_tab_get_buffer (tab);
@@ -120,10 +121,15 @@ create_dialog (GTask *task)
        g_free (file_short_name);
        file_short_name = NULL;
 
-       gtk_dialog_add_buttons (GTK_DIALOG (dialog),
-                               _("Close _without Saving"), GTK_RESPONSE_CLOSE,
-                               _("_Cancel"), GTK_RESPONSE_CANCEL,
-                               NULL);
+       close_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+                                             _("Close _without Saving"),
+                                             GTK_RESPONSE_CLOSE);
+       gtk_style_context_add_class (gtk_widget_get_style_context (close_button),
+                                    GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
+
+       gtk_dialog_add_button (GTK_DIALOG (dialog),
+                              _("_Cancel"),
+                              GTK_RESPONSE_CANCEL);
 
        if (location != NULL)
        {


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