[Xfce4-commits] [xfce/thunar] 01/06: Use Alt_L instead of F10 to toggle the menubar (bug #10250)

noreply at xfce.org noreply at xfce.org
Fri May 15 18:37:05 CEST 2015


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

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit 9283ed8fd5ff7c7cf7a089a528e26784a3a04eca
Author: Harald Judt <h.judt at gmx.at>
Date:   Wed May 13 22:17:21 2015 +0200

    Use Alt_L instead of F10 to toggle the menubar (bug #10250)
    
    Other applications like firefox, thunderbird etc. use Alt_L to toggle
    a hidden menubar. This seems to be some kind of standard and is also
    more intuitive because menu mnemonics are triggered by Alt_L too.
    
    The second part of this commit fixes hiding the menubar (if set to
    be invisible).
    
    Of course, the setting still needs to be activated in the view menu or
    via Control + M.
---
 thunar/thunar-window.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 42be0a8..38b3afb 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -625,7 +625,7 @@ thunar_window_class_init (ThunarWindowClass *klass)
   gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, "back", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_F5, 0, "reload", 1, G_TYPE_BOOLEAN, TRUE);
   gtk_binding_entry_add_signal (binding_set, GDK_F9, 0, "toggle-sidepane", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_F10, 0, "toggle-menubar", 0);
+  gtk_binding_entry_add_signal (binding_set, GDK_Alt_L, 0, "toggle-menubar", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, GDK_CONTROL_MASK, "zoom-in", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_KP_Subtract, GDK_CONTROL_MASK, "zoom-out", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_KP_0, GDK_CONTROL_MASK, "zoom-reset", 0);
@@ -1199,6 +1199,8 @@ thunar_window_toggle_sidepane (ThunarWindow *window)
 static gboolean
 thunar_window_toggle_menubar (ThunarWindow *window)
 {
+  GtkAction *action;
+
   _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE);
 
   if (!gtk_widget_get_visible (window->menubar))
@@ -1207,6 +1209,13 @@ thunar_window_toggle_menubar (ThunarWindow *window)
       gtk_widget_show (window->menubar);
       return TRUE;
     }
+  else
+    {
+      /* or hide it again */
+      action = gtk_action_group_get_action (window->action_group, "view-menubar");
+      if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
+        gtk_widget_hide (window->menubar);
+    }
 
   return FALSE;
 }

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


More information about the Xfce4-commits mailing list