diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-10-29 22:55:29 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-10-29 22:55:29 -0400 |
commit | a953e377359d001160e2c9700c8fdd163a14c2b4 (patch) | |
tree | 02e45b832f9a167670a06165e78acb645f199a10 /gtk/gtkbutton.c | |
parent | e39b8611bd20e602102a7e1b8e06e34c1b85cfe5 (diff) | |
download | gtk+-a953e377359d001160e2c9700c8fdd163a14c2b4.tar.gz |
button: Use an element name instead of a style class
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r-- | gtk/gtkbutton.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 8abbcebe31..f976194caf 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -34,6 +34,15 @@ * The #GtkButton widget can hold any valid child widget. That is, it can hold * almost any other standard #GtkWidget. The most commonly used child is the * #GtkLabel. + * + * # CSS nodes + * + * GtkButton has a single CSS node with name button. The node will get the + * style classes .image-button or .text-button, if the content is just an + * image or label, respectively. It may also receive the .flat style class. + * + * Other style classes that are commonly used with GtkButton include + * .suggested-action and .destructive-action. */ #include "config.h" @@ -579,6 +588,7 @@ gtk_button_class_init (GtkButtonClass *klass) GTK_PARAM_READABLE)); gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_BUTTON_ACCESSIBLE); + gtk_widget_class_set_css_name (widget_class, "button"); } static void @@ -658,7 +668,6 @@ static void gtk_button_init (GtkButton *button) { GtkButtonPrivate *priv; - GtkStyleContext *context; button->priv = gtk_button_get_instance_private (button); priv = button->priv; @@ -683,9 +692,6 @@ gtk_button_init (GtkButton *button) priv->image_position = GTK_POS_LEFT; priv->use_action_appearance = TRUE; - context = gtk_widget_get_style_context (GTK_WIDGET (button)); - gtk_style_context_add_class (context, GTK_STYLE_CLASS_BUTTON); - priv->gesture = gtk_gesture_multi_press_new (GTK_WIDGET (button)); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->gesture), FALSE); gtk_gesture_single_set_exclusive (GTK_GESTURE_SINGLE (priv->gesture), TRUE); |