From b9a51f353064aceed3ac512bb7d4558fcf99d771 Mon Sep 17 00:00:00 2001 From: GMT 1998 Austin Donnelly Date: Sun, 1 Nov 1998 21:10:44 +0000 Subject: gtk/gtkoptionmenu.c make option menus work when some of the menuitems are Sun Nov 1 21:00:06 GMT 1998 Austin Donnelly * gtk/gtkoptionmenu.c * gtk/gtkmenushell.c: make option menus work when some of the menuitems are hidden - previously, option menu would popup too high. --- gtk/gtkmenushell.c | 8 ++++++-- gtk/gtkoptionmenu.c | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index a6a3bb20df..ad90966211 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -868,7 +868,9 @@ gtk_menu_shell_move_selected (GtkMenuShell *menu_shell, { node = node->next; while (node != start_node && - (!node || !GTK_WIDGET_SENSITIVE (node->data))) + (!node || + !GTK_WIDGET_SENSITIVE (node->data) || + !GTK_WIDGET_VISIBLE (node->data) )) { if (!node) node = menu_shell->children; @@ -880,7 +882,9 @@ gtk_menu_shell_move_selected (GtkMenuShell *menu_shell, { node = node->prev; while (node != start_node && - (!node || !GTK_WIDGET_SENSITIVE (node->data))) + (!node || + !GTK_WIDGET_SENSITIVE (node->data) || + !GTK_WIDGET_VISIBLE (node->data) )) { if (!node) node = g_list_last (menu_shell->children); diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c index aadbc7e155..6f520156f3 100644 --- a/gtk/gtkoptionmenu.c +++ b/gtk/gtkoptionmenu.c @@ -637,7 +637,9 @@ gtk_option_menu_position (GtkMenu *menu, if (active == child) break; - menu_ypos -= child->allocation.height; + if (GTK_WIDGET_VISIBLE (child)) + menu_ypos -= child->allocation.height; + children = children->next; } -- cgit v1.2.1