togglebutton: Add a style class
This lets us differentiate toggle buttons from plain buttons with button.toggle, without having to redo all the styling.
This commit is contained in:
@ -220,9 +220,14 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
|
|||||||
static void
|
static void
|
||||||
gtk_toggle_button_init (GtkToggleButton *toggle_button)
|
gtk_toggle_button_init (GtkToggleButton *toggle_button)
|
||||||
{
|
{
|
||||||
|
GtkStyleContext *context;
|
||||||
|
|
||||||
toggle_button->priv = gtk_toggle_button_get_instance_private (toggle_button);
|
toggle_button->priv = gtk_toggle_button_get_instance_private (toggle_button);
|
||||||
toggle_button->priv->active = FALSE;
|
toggle_button->priv->active = FALSE;
|
||||||
toggle_button->priv->draw_indicator = 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
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user