[Xfce4-commits] [apps/xfce4-terminal] 01/01: Allow underscores that are part of tab titles to be shown in the tabs menu

noreply at xfce.org noreply at xfce.org
Wed Jan 24 01:08:12 CET 2018


This is an automated email from the git hooks/post-receive script.

f   2   4   0   4       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-terminal.

commit 300d136e1c9ab2c2a687c11a8ccd7b470816ee36
Author: Igor <f2404 at yandex.ru>
Date:   Tue Jan 23 19:06:01 2018 -0500

    Allow underscores that are part of tab titles to be shown in the tabs menu
    
    They used to be treated as accelerators and thus swallowed.
---
 terminal/terminal-window.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 4af3bc6..e678c8f 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -2956,7 +2956,7 @@ terminal_window_rebuild_tabs_menu (TerminalWindow *window)
   GtkWidget      *page;
   GSList         *group = NULL;
   GtkRadioAction *radio_action;
-  gchar           name[50];
+  gchar           name[50], menu_item_name[100];
   GSList         *lp;
   GtkAccelKey     key = {0};
 
@@ -3011,22 +3011,26 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       g_object_set_qdata_full (G_OBJECT (page), tabs_menu_action_quark,
                                radio_action, g_object_unref);
 
-      /* add action in the menu */
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+      /* add action in the menu */
       gtk_ui_manager_add_ui (window->priv->ui_manager, window->priv->tabs_menu_merge_id,
                              "/main-menu/tabs-menu/placeholder-tab-items",
                              name, name, GTK_UI_MANAGER_MENUITEM, FALSE);
-G_GNUC_END_IGNORE_DEPRECATIONS
+      /* allow underscore to be shown */
+      g_snprintf (menu_item_name, sizeof (menu_item_name), "/main-menu/tabs-menu/placeholder-tab-items/%s", name);
+      gtk_menu_item_set_use_underline (GTK_MENU_ITEM (gtk_ui_manager_get_widget (window->priv->ui_manager, menu_item_name)), FALSE);
 
       if (npages > 1)
         {
           /* add to right-click tab menu */
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
           gtk_ui_manager_add_ui (window->priv->ui_manager, window->priv->tabs_menu_merge_id,
                                  "/tab-menu/tabs-menu/placeholder-tab-items",
                                  name, name, GTK_UI_MANAGER_MENUITEM, FALSE);
-G_GNUC_END_IGNORE_DEPRECATIONS
+          /* allow underscore to be shown */
+          g_snprintf (menu_item_name, sizeof (menu_item_name), "/tab-menu/tabs-menu/placeholder-tab-items/%s", name);
+          gtk_menu_item_set_use_underline (GTK_MENU_ITEM (gtk_ui_manager_get_widget (window->priv->ui_manager, menu_item_name)), FALSE);
         }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
       /* set an accelerator path */
       g_snprintf (name, sizeof (name), "<Actions>/terminal-window/goto-tab-%d", n + 1);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list