[gtk+] Add GTK_STYLE_CLASS_SUGGESTED_ACTION



commit de4237612240d2746ceae23d327d722d8c5077c9
Author: William Jon McCann <william jon mccann gmail com>
Date:   Fri Feb 7 10:25:00 2014 -0500

    Add GTK_STYLE_CLASS_SUGGESTED_ACTION

 gtk/gtkassistant.c    |    2 +-
 gtk/gtkdialog.c       |    4 ++--
 gtk/gtkstylecontext.h |   10 ++++++++++
 3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 7ef9d4b..c83790d 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -342,7 +342,7 @@ add_action_widgets (GtkAssistant *assistant)
           if (has_default)
             {
               gtk_widget_grab_default (child);
-              gtk_style_context_add_class (gtk_widget_get_style_context (child), "suggested-action");
+              gtk_style_context_add_class (gtk_widget_get_style_context (child), 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
             }
         }
       g_list_free (children);
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 652be99..cf09b25 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -425,7 +425,7 @@ add_action_widgets (GtkDialog *dialog)
           if (has_default)
             {
               gtk_widget_grab_default (child);
-              gtk_style_context_add_class (gtk_widget_get_style_context (child), "suggested-action");
+              gtk_style_context_add_class (gtk_widget_get_style_context (child), 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
             }
         }
       g_list_free (children);
@@ -1105,7 +1105,7 @@ gtk_dialog_set_default_response (GtkDialog *dialog,
         {
          gtk_widget_grab_default (widget);
           if (dialog->priv->constructed && dialog->priv->use_header_bar == 1)
-            gtk_style_context_add_class (gtk_widget_get_style_context (widget), "suggested-action");
+            gtk_style_context_add_class (gtk_widget_get_style_context (widget), 
GTK_STYLE_CLASS_SUGGESTED_ACTION);
         }
 
       tmp_list = g_list_next (tmp_list);
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index d2341d5..9e1aadc 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -765,6 +765,16 @@ struct _GtkStyleContextClass
  */
 #define GTK_STYLE_CLASS_NEEDS_ATTENTION "needs-attention"
 
+/**
+ * GTK_STYLE_CLASS_SUGGESTED_ACTION:
+ *
+ * A CSS class used when an action (usually a button) is the
+ * primary suggested action in a specific context.
+ *
+ * Since: 3.12
+ */
+#define GTK_STYLE_CLASS_SUGGESTED_ACTION "suggested-action"
+
 /* Predefined set of widget regions */
 
 /**


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