From b350779a6f49679cb7a83be22f53bacde45bd282 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 29 Oct 2015 23:04:47 -0400 Subject: [PATCH] togglebutton: Add a style class This lets us differentiate toggle buttons from plain buttons with button.toggle, without having to redo all the styling. --- gtk/gtktogglebutton.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index bbe764bf92..c4ac1d4630 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -220,9 +220,14 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class) static void gtk_toggle_button_init (GtkToggleButton *toggle_button) { + GtkStyleContext *context; + toggle_button->priv = gtk_toggle_button_get_instance_private (toggle_button); toggle_button->priv->active = FALSE; toggle_button->priv->draw_indicator = FALSE; + + context = gtk_widget_get_style_context (GTK_WIDGET (toggle_button)); + gtk_style_context_add_class (context, "toggle"); } static void