From 47523436d544fef96e8f8fdac9bf88537e1822e9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 12 Mar 2007 05:52:23 +0000 Subject: [PATCH] Set the background of the panel window on style changes. (#402144, 2007-03-12 Matthias Clasen * gtk/gtkspinbutton.c (gtk_spin_button_style_set): Set the background of the panel window on style changes. (#402144, Benjamin Berg) svn path=/branches/gtk-2-10/; revision=17493 --- ChangeLog | 8 ++++++++ gtk/gtkspinbutton.c | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2a0f912ef8..e6cb40e6f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-03-12 Matthias Clasen + + Merge from trunk: + + * gtk/gtkspinbutton.c (gtk_spin_button_style_set): Set + the background of the panel window on style changes. (#402144, + Benjamin Berg) + 2007-03-12 Matthias Clasen * NEWS: Updates diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 7c76829cb6..4d58588aec 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 gint 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)