[gtk+/wip/unfocused-fixes] spinbutton: Use the widget state flags as a base for drawing
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/unfocused-fixes] spinbutton: Use the widget state flags as a base for drawing
- Date: Wed, 21 Dec 2011 16:19:30 +0000 (UTC)
commit 1cdba64a26981938d32db63176802a7458487d91
Author: Rui Matos <tiagomatos gmail com>
Date: Wed Dec 21 16:17:18 2011 +0000
spinbutton: Use the widget state flags as a base for drawing
gtk/gtkspinbutton.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 558b175..62c7c70 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -816,20 +816,22 @@ gtk_spin_button_panel_get_state (GtkSpinButton *spin_button,
GtkStateFlags state;
GtkSpinButtonPrivate *priv = spin_button->priv;
- if (gtk_spin_button_panel_at_limit (spin_button, panel))
- state = GTK_STATE_FLAG_INSENSITIVE;
+ state = gtk_widget_get_state_flags (GTK_WIDGET (spin_button));
+
+ state &= ~(GTK_STATE_FLAG_ACTIVE | GTK_STATE_FLAG_PRELIGHT);
+
+ if ((state & GTK_STATE_FLAG_INSENSITIVE) ||
+ gtk_spin_button_panel_at_limit (spin_button, panel))
+ {
+ state |= GTK_STATE_FLAG_INSENSITIVE;
+ }
else
{
if (priv->click_child == panel)
- state = GTK_STATE_ACTIVE;
- else
- {
- if (priv->in_child == panel &&
- priv->click_child == NULL)
- state = GTK_STATE_FLAG_PRELIGHT;
- else
- state = gtk_widget_get_state_flags (GTK_WIDGET (spin_button));
- }
+ state |= GTK_STATE_ACTIVE;
+ else if (priv->in_child == panel &&
+ priv->click_child == NULL)
+ state |= GTK_STATE_FLAG_PRELIGHT;
}
return state;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]