[Xfce4-commits] <midori:master> Allow re-ordering tabs with Ctrl+Shift+PageUp/PageDown
Christian Dywan
noreply at xfce.org
Wed Mar 2 22:28:02 CET 2011
Updating branch refs/heads/master
to 0cdcae487a88628e4f34721e3595b5597b768fbd (commit)
from 256b3510906a6b43107673ed56e403890ad55878 (commit)
commit 0cdcae487a88628e4f34721e3595b5597b768fbd
Author: Christian Dywan <christian at twotoasts.de>
Date: Wed Mar 2 18:03:55 2011 +0100
Allow re-ordering tabs with Ctrl+Shift+PageUp/PageDown
midori/midori-browser.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 9d5e98f..4b2f152 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -4381,6 +4381,24 @@ _action_inspect_page_activate (GtkAction* action,
#endif
static void
+_action_tab_move_backward_activate (GtkAction* action,
+ MidoriBrowser* browser)
+{
+ gint n = gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook));
+ GtkWidget* widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook), n);
+ gtk_notebook_reorder_child (GTK_NOTEBOOK (browser->notebook), widget, n - 1);
+}
+
+static void
+_action_tab_move_forward_activate (GtkAction* action,
+ MidoriBrowser* browser)
+{
+ gint n = gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook));
+ GtkWidget* widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook), n);
+ gtk_notebook_reorder_child (GTK_NOTEBOOK (browser->notebook), widget, n + 1);
+}
+
+static void
_action_tab_previous_activate (GtkAction* action,
MidoriBrowser* browser)
{
@@ -5037,6 +5055,10 @@ static const GtkActionEntry entries[] =
{ "TabNext", GTK_STOCK_GO_FORWARD,
N_("_Next Tab"), "<Ctrl>Page_Down",
N_("Switch to the next tab"), G_CALLBACK (_action_tab_next_activate) },
+ { "TabMoveBackward", NULL, N_("_Move Tab Backward"), "<Ctrl><Shift>Page_Up",
+ N_("Move tab behind the previous tab"), G_CALLBACK (_action_tab_move_backward_activate) },
+ { "TabMoveForward", NULL, N_("_Move Tab Forward"), "<Ctrl><Shift>Page_Down",
+ N_("Move tab in front of the next tab"), G_CALLBACK (_action_tab_move_forward_activate) },
{ "TabCurrent", NULL,
N_("Focus _Current Tab"), "<Ctrl>Home",
N_("Focus the current tab"), G_CALLBACK (_action_tab_current_activate) },
@@ -5315,6 +5337,8 @@ static const gchar* ui_markup =
/* For accelerators to work all actions need to be used
*somewhere* in the UI definition */
"<menu action='Dummy'>"
+ "<menuitem action='TabMoveBackward'/>"
+ "<menuitem action='TabMoveForward'/>"
"<menuitem action='ScrollLeft'/>"
"<menuitem action='ScrollDown'/>"
"<menuitem action='ScrollUp'/>"
More information about the Xfce4-commits
mailing list