Add GTK_STYLE_CLASS_SUGGESTED_ACTION

This commit is contained in:
William Jon McCann 2014-02-07 10:25:00 -05:00
parent 648511ed44
commit de42376122
3 changed files with 13 additions and 3 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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 */
/**