]> spindle.queued.net Git - midori/commitdiff
Alt+9 and Alt+0 should always go to the last tab
authorChristian Dywan <christian@twotoasts.de>
Sat, 26 Feb 2011 15:23:56 +0000 (16:23 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 26 Feb 2011 15:23:56 +0000 (16:23 +0100)
midori/midori-browser.c

index cafa5fbea0f6eecd654bb3e6bf7b2841c3c34c84..5a77b3f77ed661a27c2d72d72133340020e6356a 100644 (file)
@@ -5422,12 +5422,11 @@ midori_browser_accel_switch_tab_activate_cb (GtkAccelGroup*  accel_group,
         MidoriBrowser* browser;
         GtkWidget* view;
 
+        /* Switch to n-th tab. 9 and 0 go to the last tab. */
         n = keyval - GDK_0;
-        if (n == 0)
-            n = 10;
         browser = g_object_get_data (G_OBJECT (accel_group), "midori-browser");
         if ((view = gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook),
-                                          n - 1)))
+                                               n < 9 ? n - 1 : -1)))
             midori_browser_set_current_tab (browser, view);
     }
 }