[gtk+/theming: 7/14] switch: propagate the active state to the slider
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/theming: 7/14] switch: propagate the active state to the slider
- Date: Thu, 3 Mar 2011 14:26:40 +0000 (UTC)
commit 375e547dbf40aaaff5be133d2fd9eeccd85b545b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Feb 28 18:46:46 2011 -0500
switch: propagate the active state to the slider
gtk/gtkswitch.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index d69534c..1a8e427 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -473,11 +473,15 @@ gtk_switch_paint_handle (GtkWidget *widget,
cairo_t *cr,
GdkRectangle *box)
{
+ GtkSwitchPrivate *priv = GTK_SWITCH (widget)->priv;
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GtkStateFlags state;
state = gtk_widget_get_state_flags (widget);
+ if (priv->is_active)
+ state |= GTK_STATE_FLAG_ACTIVE;
+
gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SLIDER);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]