[gtk+/gtk-2-22] Respect GtkEntry::state-hint when drawing spinbutton features
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-22] Respect GtkEntry::state-hint when drawing spinbutton features
- Date: Mon, 12 Jul 2010 17:12:03 +0000 (UTC)
commit 47836a3af185ab173795d24911bf2f97dc29f8c9
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jul 9 22:23:25 2010 -0400
Respect GtkEntry::state-hint when drawing spinbutton features
As proposed in bug 589904 by Thomas Wood.
(cherry picked from commit bcbb976d916dfeda5ca4ca9695b3035e22aee85b)
gtk/gtkspinbutton.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index cebdd55..23288c7 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -742,11 +742,20 @@ gtk_spin_button_expose (GtkWidget *widget,
if (shadow_type != GTK_SHADOW_NONE)
{
gint width, height;
+ gboolean state_hint;
+ GtkStateType state;
+
+ gtk_widget_style_get (widget, "state-hint", &state_hint, NULL);
+ if (state_hint)
+ state = gtk_widget_has_focus (widget) ?
+ GTK_STATE_ACTIVE : gtk_widget_get_state (widget);
+ else
+ state = GTK_STATE_NORMAL;
gdk_drawable_get_size (spin->panel, &width, &height);
gtk_paint_box (widget->style, spin->panel,
- GTK_STATE_NORMAL, shadow_type,
+ state, shadow_type,
&event->area, widget, "spinbutton",
0, 0, width, height);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]