[epiphany] Update sensitivity for move tab to left/right based on position. https://bugzilla.gnome.org/show_bug



commit 1cbf46caf2a8339731bcd20ff76f2fb1cb7eb90b
Author: Robert Roth <robert roth off gmail com>
Date:   Fri May 2 13:23:22 2014 +0300

    Update sensitivity for move tab to left/right based on position. 
https://bugzilla.gnome.org/show_bug.cgi?id=708524
    
    Disable move to left action for the first tab and disable move to right
    action for the last tab.

 src/ephy-window.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 618350b..59ec193 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2573,6 +2573,21 @@ show_notebook_popup_menu (GtkNotebook *notebook,
 
        if (event != NULL)
        {
+               gint n_pages, page_num;
+
+               tab = GTK_WIDGET (window->priv->active_embed);
+               n_pages = gtk_notebook_get_n_pages (notebook);
+               page_num = gtk_notebook_page_num (notebook, tab);
+
+               /* enable/disable move left/right items*/
+               action = gtk_action_group_get_action (window->priv->action_group,
+                                                     "TabsMoveLeft");
+               gtk_action_set_sensitive (action, page_num > 0);
+
+               action = gtk_action_group_get_action (window->priv->action_group,
+                                                     "TabsMoveRight");
+               gtk_action_set_sensitive (action, page_num < n_pages - 1);
+
                gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
                                NULL, NULL,
                                event->button, event->time);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]