[gtk+/gtk-style-context] GtkButton: Set widget state as state flags.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context] GtkButton: Set widget state as state flags.
- Date: Mon, 1 Nov 2010 03:02:16 +0000 (UTC)
commit 05b990bf83bc148f022d268717698c7f88778898
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 31 14:38:26 2010 +0100
GtkButton: Set widget state as state flags.
gtk/gtkbutton.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index fc20050..5ac1d21 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2262,20 +2262,21 @@ static void
gtk_button_update_state (GtkButton *button)
{
gboolean depressed;
- GtkStateType new_state;
+ GtkStateFlags new_state = 0;
if (button->activate_timeout)
depressed = button->depress_on_activate;
else
depressed = button->in_button && button->button_down;
- if (button->in_button && (!button->button_down || !depressed))
- new_state = GTK_STATE_PRELIGHT;
- else
- new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL;
+ if (button->in_button)
+ new_state |= GTK_STATE_FLAG_PRELIGHT;
+
+ if (button->button_down || depressed)
+ new_state |= GTK_STATE_FLAG_ACTIVE;
- _gtk_button_set_depressed (button, depressed);
- gtk_widget_set_state (GTK_WIDGET (button), new_state);
+ _gtk_button_set_depressed (button, depressed);
+ gtk_widget_set_state_flags (GTK_WIDGET (button), new_state, TRUE);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]