[gnome-control-center] privacy: Set destructive-action for confirmation buttons only



commit 22daedad493923b9c895365c9c02e106b5f2671e
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Tue Feb 14 13:59:16 2017 -0500

    privacy: Set destructive-action for confirmation buttons only
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778567

 panels/privacy/cc-privacy-panel.c |    4 ++++
 panels/privacy/privacy.ui         |    6 ------
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/panels/privacy/cc-privacy-panel.c b/panels/privacy/cc-privacy-panel.c
index ee4eb9e..b096721 100644
--- a/panels/privacy/cc-privacy-panel.c
+++ b/panels/privacy/cc-privacy-panel.c
@@ -1035,6 +1035,7 @@ static gboolean
 run_warning (GtkWindow *parent, char *prompt, char *text, char *button_title)
 {
   GtkWidget *dialog;
+  GtkWidget *button;
   int result;
   dialog = gtk_message_dialog_new (parent,
                                    0,
@@ -1050,6 +1051,9 @@ run_warning (GtkWindow *parent, char *prompt, char *text, char *button_title)
 
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), FALSE);
 
+  button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+  gtk_style_context_add_class (gtk_widget_get_style_context (button), "destructive-action");
+
   result = gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_destroy (dialog);
 
diff --git a/panels/privacy/privacy.ui b/panels/privacy/privacy.ui
index 295af91..14bdc1b 100644
--- a/panels/privacy/privacy.ui
+++ b/panels/privacy/privacy.ui
@@ -594,9 +594,6 @@
                 <property name="halign">center</property>
                 <property name="valign">center</property>
                 <property name="use_underline">True</property>
-                <style>
-                  <class name="destructive-action"/>
-                </style>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -613,9 +610,6 @@
                 <property name="halign">center</property>
                 <property name="valign">center</property>
                 <property name="use_underline">True</property>
-                <style>
-                  <class name="destructive-action"/>
-                </style>
               </object>
               <packing>
                 <property name="expand">False</property>


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