diff options
author | Xan Lopez <xlopez@igalia.com> | 2011-06-28 17:00:41 +0200 |
---|---|---|
committer | Xan Lopez <xlopez@igalia.com> | 2011-07-01 04:20:16 +0200 |
commit | fb3464fb3a85f754991185cb30326b76e033b166 (patch) | |
tree | c65208a31bba41fbdc0a9992e72e9799c967f6b8 | |
parent | ec7104e2821377433837f229f77083e77407f4a9 (diff) | |
download | epiphany-fb3464fb3a85f754991185cb30326b76e033b166.tar.gz |
ephy-window: the move tab actions should not depend on wrap-around
They do not make sense on the first/last tab.
-rw-r--r-- | src/ephy-window.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 023a97be2..136449e70 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2757,11 +2757,15 @@ update_tabs_menu_sensitivity (EphyWindow *window) GtkAction *action; GtkNotebook *notebook; gboolean wrap_around; - int n_pages; + int page, n_pages; + gboolean not_first, not_last; notebook = GTK_NOTEBOOK (priv->notebook); action_group = priv->action_group; n_pages = gtk_notebook_get_n_pages (notebook); + page = gtk_notebook_get_current_page (notebook); + not_first = page > 0; + not_last = page + 1 < n_pages; g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)), "gtk-keynav-wrap-around", &wrap_around, @@ -2769,23 +2773,16 @@ update_tabs_menu_sensitivity (EphyWindow *window) if (!wrap_around) { - int page; - gboolean not_first, not_last; - - page = gtk_notebook_get_current_page (notebook); - not_first = page > 0; - not_last = page + 1 < n_pages; - action = gtk_action_group_get_action (action_group, "TabsPrevious"); gtk_action_set_sensitive (action, not_first); action = gtk_action_group_get_action (action_group, "TabsNext"); gtk_action_set_sensitive (action, not_last); - action = gtk_action_group_get_action (action_group, "TabsMoveLeft"); - gtk_action_set_sensitive (action, not_first); - action = gtk_action_group_get_action (action_group, "TabsMoveRight"); - gtk_action_set_sensitive (action, not_last); } + action = gtk_action_group_get_action (action_group, "TabsMoveLeft"); + gtk_action_set_sensitive (action, not_first); + action = gtk_action_group_get_action (action_group, "TabsMoveRight"); + gtk_action_set_sensitive (action, not_last); action = gtk_action_group_get_action (action_group, "TabsDetach"); ephy_action_change_sensitivity_flags (action, SENS_FLAG_CHROME, n_pages <= 1); } |