_action_by_name (browser, "TabCurrent"));
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
+ menuitem = gtk_action_create_menu_item (
+ _action_by_name (browser, "NextView"));
+ gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
+ gtk_widget_show (menuitem);
menuitem = gtk_action_create_menu_item (
_action_by_name (browser, "TabNext"));
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_grab_focus (view);
}
+static void
+_action_next_view_activate (GtkAction* action,
+ MidoriBrowser* browser)
+{
+ gtk_widget_grab_focus (midori_browser_get_current_tab (browser));
+}
+
static void
_action_tab_minimize_activate (GtkAction* action,
MidoriBrowser* browser)
(GSourceFunc)midori_browser_panel_timeout, hpaned, NULL);
}
+static gboolean
+midori_panel_cycle_child_focus_cb (GtkWidget* hpaned,
+ gboolean reversed,
+ MidoriBrowser* browser)
+{
+ /* Default cycle goes between all GtkPaned widgets.
+ If focus is in the panel, focus the location as if it's a paned.
+ If nothing is focussed, simply go to the location.
+ Be sure to suppress the default because the signal can recurse. */
+ GtkWidget* focus = gtk_window_get_focus (GTK_WINDOW (browser));
+ if (gtk_widget_get_ancestor (focus, MIDORI_TYPE_PANEL)
+ || !gtk_widget_get_ancestor (focus, GTK_TYPE_PANED))
+ {
+ g_signal_stop_emission_by_name (hpaned, "cycle-child-focus");
+ gtk_action_activate (_action_by_name (browser, "Location"));
+ return TRUE;
+ }
+ return FALSE;
+}
+
static void
midori_panel_notify_page_cb (MidoriPanel* panel,
GParamSpec* pspec,
{ "TabCurrent", NULL,
N_("Focus _Current Tab"), "<Ctrl>Home",
N_("Focus the current tab"), G_CALLBACK (_action_tab_current_activate) },
+ { "NextView", NULL,
+ N_("Focus _Next view"), "F6",
+ N_("Cycle focus between views"), G_CALLBACK (_action_next_view_activate) },
{ "TabMinimize", NULL,
N_("Only show the Icon of the _Current Tab"), "",
N_("Only show the icon of the current tab"), G_CALLBACK (_action_tab_minimize_activate) },
"<menuitem action='TabPrevious'/>"
"<menuitem action='TabNext'/>"
"<menuitem action='TabCurrent'/>"
+ "<menuitem action='NextView'/>"
"<menuitem action='TabMinimize'/>"
"<menuitem action='TabDuplicate'/>"
"<menuitem action='TabCloseOther'/>"
g_signal_connect (hpaned, "notify::position",
G_CALLBACK (midori_panel_notify_position_cb),
browser);
+ g_signal_connect (hpaned, "cycle-child-focus",
+ G_CALLBACK (midori_panel_cycle_child_focus_cb),
+ browser);
gtk_box_pack_start (GTK_BOX (vbox), hpaned, TRUE, TRUE, 0);
gtk_widget_show (hpaned);
browser->panel = g_object_new (MIDORI_TYPE_PANEL,