summaryrefslogtreecommitdiff
path: root/gtk/gtkmenubar.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-07-25 18:17:28 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-07-25 18:17:28 +0000
commit4e84b6662829a84988a50445f0a62954381501b8 (patch)
treefda6f9e697c7d0d01bfb15786440a3179574bdf3 /gtk/gtkmenubar.c
parenteccc076085e32ad7eb1d9fe3e460764ec1aff279 (diff)
downloadgtk+-4e84b6662829a84988a50445f0a62954381501b8.tar.gz
When a menubar is up, use F10 to cycle menubars, not Control-Tab (#87159,
Thu Jul 25 14:14:46 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenushell.c: When a menubar is up, use F10 to cycle menubars, not Control-Tab (#87159, Calum Benson. Patch from Padraig O'Briain.) * gtk/gtkmenubar.c: When cycling menu bars, cancel after the last instead of wrapping around.
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r--gtk/gtkmenubar.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index 7f891f2f15..cc1e67d204 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -532,13 +532,13 @@ _gtk_menu_bar_cycle_focus (GtkMenuBar *menubar,
GtkDirectionType dir)
{
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menubar));
+ GtkMenuItem *to_activate = NULL;
if (GTK_WIDGET_TOPLEVEL (toplevel))
{
GList *tmp_menubars = get_viewable_menu_bars (GTK_WINDOW (toplevel));
GList *menubars;
GList *current;
- GtkMenuBar *new;
menubars = _gtk_container_focus_sort (GTK_CONTAINER (toplevel), tmp_menubars,
dir, GTK_WIDGET (menubar));
@@ -547,26 +547,22 @@ _gtk_menu_bar_cycle_focus (GtkMenuBar *menubar,
if (menubars)
{
current = g_list_find (menubars, menubar);
+
if (current && current->next)
- new = current->next->data;
- else
- new = menubars->data;
-
- if (new != menubar)
{
- GtkMenuShell *new_menushell = GTK_MENU_SHELL (new);
-
+ GtkMenuShell *new_menushell = GTK_MENU_SHELL (current->next->data);
if (new_menushell->children)
- {
- g_signal_emit_by_name (menubar, "cancel", 0);
- gtk_signal_emit_by_name (GTK_OBJECT (new_menushell->children->data),
- "activate_item");
- }
+ to_activate = new_menushell->children->data;
}
}
g_list_free (menubars);
}
+
+ g_signal_emit_by_name (menubar, "cancel", 0);
+
+ if (to_activate)
+ g_signal_emit_by_name (to_activate, "activate_item");
}
static GtkShadowType