summaryrefslogtreecommitdiff
path: root/gtk/gtkspinbutton.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2007-03-12 05:51:11 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-03-12 05:51:11 +0000
commit7b8bbe868786f1074795338de835b2579c0515ca (patch)
tree0d1d299db848e8cc31e162ec63f8261ca72ef789 /gtk/gtkspinbutton.c
parent45f6f399f5e3b0310b516e8b2734ede87e8ee47e (diff)
downloadgtk+-7b8bbe868786f1074795338de835b2579c0515ca.tar.gz
Set the background of the panel window on style changes. (#402144,
2007-03-12 Matthias Clasen <mclasen@redhat.com> * gtk/gtkspinbutton.c (gtk_spin_button_style_set): Set the background of the panel window on style changes. (#402144, Benjamin Berg) svn path=/trunk/; revision=17492
Diffstat (limited to 'gtk/gtkspinbutton.c')
-rw-r--r--gtk/gtkspinbutton.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index bf2e59632b..c7d222128d 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -110,6 +110,8 @@ static void gtk_spin_button_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_spin_button_state_changed (GtkWidget *widget,
GtkStateType previous_state);
+static void gtk_spin_button_style_set (GtkWidget *widget,
+ GtkStyle *previous_style);
static void gtk_spin_button_draw_arrow (GtkSpinButton *spin_button,
GtkArrowType arrow_type);
static gboolean gtk_spin_button_timer (GtkSpinButton *spin_button);
@@ -191,6 +193,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
widget_class->focus_out_event = gtk_spin_button_focus_out;
widget_class->grab_notify = gtk_spin_button_grab_notify;
widget_class->state_changed = gtk_spin_button_state_changed;
+ widget_class->style_set = gtk_spin_button_style_set;
entry_class->activate = gtk_spin_button_activate;
@@ -974,6 +977,19 @@ gtk_spin_button_state_changed (GtkWidget *widget,
}
}
+static void
+gtk_spin_button_style_set (GtkWidget *widget,
+ GtkStyle *previous_style)
+{
+ GtkSpinButton *spin = GTK_SPIN_BUTTON (widget);
+
+ if (previous_style && GTK_WIDGET_REALIZED (widget))
+ gtk_style_set_background (widget->style, spin->panel, GTK_STATE_NORMAL);
+
+ (* GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->style_set) (widget, previous_style);
+}
+
+
static gint
gtk_spin_button_scroll (GtkWidget *widget,
GdkEventScroll *event)