[gtk+] switch: propagate the active state to the slider
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] switch: propagate the active state to the slider
- Date: Thu, 3 Mar 2011 22:49:24 +0000 (UTC)
commit c310c35a7a87307c1534a932f43f9255d26faa9b
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]