aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-06-28 23:00:41 +0800
committerXan Lopez <xlopez@igalia.com>2011-06-29 03:02:30 +0800
commit444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4 (patch)
tree6bb41cc334dbadbb57dbc542442baf1624e4a8d3 /src/ephy-window.c
parent94b6f749b951b28bb8024adc9d48cf2871bf3f01 (diff)
downloadgsoc2013-epiphany-444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4.tar
gsoc2013-epiphany-444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4.tar.gz
gsoc2013-epiphany-444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4.tar.bz2
gsoc2013-epiphany-444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4.tar.lz
gsoc2013-epiphany-444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4.tar.xz
gsoc2013-epiphany-444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4.tar.zst
gsoc2013-epiphany-444c593b9b9449ecd7dbfc5d7ad4c812f941c0f4.zip
ephy-window: the move tab actions should not depend on wrap-around
They do not make sense on the first/last tab.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 9f459b74e..cd03516cf 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2840,11 +2840,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,
@@ -2852,23 +2856,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);
}