[gtk+/gtk-style-context: 302/490] GtkMenuItem: Set widget state as state flags.



commit 369fbf84701721ca5aa1d47746e1cab2a766b25a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 31 14:44:09 2010 +0100

    GtkMenuItem: Set widget state as state flags.

 gtk/gtkmenuitem.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index d0dd5e9..7a94bed 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1626,7 +1626,8 @@ gtk_real_menu_item_select (GtkMenuItem *menu_item)
       _gtk_menu_item_popup_submenu (GTK_WIDGET (menu_item), TRUE);
     }
 
-  gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_PRELIGHT);
+  gtk_widget_set_state_flags (GTK_WIDGET (menu_item),
+                              GTK_STATE_FLAG_PRELIGHT, FALSE);
   gtk_widget_queue_draw (GTK_WIDGET (menu_item));
 }
 
@@ -1636,7 +1637,8 @@ gtk_real_menu_item_deselect (GtkMenuItem *menu_item)
   if (menu_item->submenu)
     _gtk_menu_item_popdown_submenu (GTK_WIDGET (menu_item));
 
-  gtk_widget_set_state (GTK_WIDGET (menu_item), GTK_STATE_NORMAL);
+  gtk_widget_unset_state_flags (GTK_WIDGET (menu_item),
+                                GTK_STATE_FLAG_PRELIGHT);
   gtk_widget_queue_draw (GTK_WIDGET (menu_item));
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]