diff options
author | Tim Janik <timj@gtk.org> | 1999-01-11 12:22:52 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1999-01-11 12:22:52 +0000 |
commit | e3ee9e9d7dab56082480e2c77191d00f2e559670 (patch) | |
tree | f4ae947e100784a18c580caca44da31e9a1382da /gtk/gtkmenuitem.c | |
parent | f3af00f4501d4f019146b1be468fb81723f6da1a (diff) | |
download | gtk+-e3ee9e9d7dab56082480e2c77191d00f2e559670.tar.gz |
only pass key events to the focus widget if it is sensitive.
Mon Jan 11 13:18:37 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
(gtk_window_key_release_event):
(gtk_window_key_press_event): only pass key events to the focus widget
if it is sensitive.
* gtk/gtkmenuitem.c (gtk_menu_item_select_timeout): don't popup the
submenu if it isn't sensitive.
(gtk_menu_item_paint): state_type doesn't need to be reset to
GTK_STATE_INSENSITIVE if the widget is insensitive anyways.
* gtk/gtkcontainer.c (gtk_container_real_focus):
* gtk/gtklist.c (gtk_list_focus):
* gtk/gtkmenushell.c (gtk_menu_shell_move_selected):
* gtk/gtknotebook.c (gtk_notebook_focus):
s/GTK_WIDGET_SENSITIVE/GTK_WIDGET_IS_SENSITIVE/ since a widgets
sensitivity is determined through the parent as well,
GTK_WIDGET_SENSITIVE is only of interest inside gtkwidget.c, everywhere
else GTK_WIDGET_IS_SENSITIVE (widget) needs to be used to check for
sensitivity.
* gtk/gtkaccelgroup.c (gtk_accel_group_activate): don't activate
object if it is an insensitive widget.
Diffstat (limited to 'gtk/gtkmenuitem.c')
-rw-r--r-- | gtk/gtkmenuitem.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index a42893cd4e..4b506e0157 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -423,8 +423,6 @@ gtk_menu_item_paint (GtkWidget *widget, menu_item = GTK_MENU_ITEM (widget); state_type = widget->state; - if (!GTK_WIDGET_IS_SENSITIVE (widget)) - state_type = GTK_STATE_INSENSITIVE; x = GTK_CONTAINER (menu_item)->border_width; y = GTK_CONTAINER (menu_item)->border_width; @@ -627,24 +625,27 @@ gtk_menu_item_select_timeout (gpointer data) menu_item = GTK_MENU_ITEM (data); menu_item->timer = 0; - gtk_menu_popup (GTK_MENU (menu_item->submenu), - GTK_WIDGET (menu_item)->parent, - GTK_WIDGET (menu_item), - gtk_menu_item_position_menu, - menu_item, - GTK_MENU_SHELL (GTK_WIDGET (menu_item)->parent)->button, - 0); - - /* This is a bit of a hack - we want to select the first item - * of menus hanging of a menu bar, but not for cascading submenus - */ - if (GTK_IS_MENU_BAR (GTK_WIDGET (menu_item)->parent)) + if (GTK_WIDGET_IS_SENSITIVE (menu_item->submenu)) { - GtkMenuShell *submenu = GTK_MENU_SHELL (menu_item->submenu); - if (submenu->children) - gtk_menu_shell_select_item (submenu, submenu->children->data); + gtk_menu_popup (GTK_MENU (menu_item->submenu), + GTK_WIDGET (menu_item)->parent, + GTK_WIDGET (menu_item), + gtk_menu_item_position_menu, + menu_item, + GTK_MENU_SHELL (GTK_WIDGET (menu_item)->parent)->button, + 0); + + /* This is a bit of a hack - we want to select the first item + * of menus hanging of a menu bar, but not for cascading submenus + */ + if (GTK_IS_MENU_BAR (GTK_WIDGET (menu_item)->parent)) + { + GtkMenuShell *submenu = GTK_MENU_SHELL (menu_item->submenu); + if (submenu->children) + gtk_menu_shell_select_item (submenu, submenu->children->data); + } } - + GDK_THREADS_LEAVE (); return FALSE; |