[gedit] Fix sensitivity of Move to New Tab Group.



commit 063582cef69bd610e8c86e5eadd64ac3dbab7948
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Jan 8 09:02:00 2014 +0100

    Fix sensitivity of Move to New Tab Group.
    
    You do not want this item sensitive unless there is more than 1 tab.

 gedit/gedit-notebook-popup-menu.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-notebook-popup-menu.c b/gedit/gedit-notebook-popup-menu.c
index a252a1e..9ff3596 100644
--- a/gedit/gedit-notebook-popup-menu.c
+++ b/gedit/gedit-notebook-popup-menu.c
@@ -31,6 +31,7 @@ struct _GeditNotebookPopupMenuPrivate
 
        GtkWidget *move_left_item;
        GtkWidget *move_right_item;
+       GtkWidget *move_to_new_tab_group_item;
        GtkWidget *close_item;
 };
 
@@ -122,6 +123,8 @@ update_sensitivity (GeditNotebookPopupMenu *menu)
                                  (state != GEDIT_TAB_STATE_PRINT_PREVIEWING) &&
                                  (state != GEDIT_TAB_STATE_SAVING_ERROR));
 
+       gtk_widget_set_sensitive (menu->priv->move_to_new_tab_group_item, n_pages > 1);
+
        gtk_widget_set_sensitive (menu->priv->move_left_item, page_num > 0);
        gtk_widget_set_sensitive (menu->priv->move_right_item, page_num < n_pages - 1);
 }
@@ -256,6 +259,7 @@ gedit_notebook_popup_menu_init (GeditNotebookPopupMenu *menu)
                          menu);
        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
        gtk_widget_show (menu_item);
+       menu->priv->move_to_new_tab_group_item = menu_item;
 
        menu_item = gtk_menu_item_new_with_mnemonic (_("_Move to New Window"));
        g_signal_connect (menu_item, "activate",


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