Commit 9283ed8f authored by Harald Judt's avatar Harald Judt

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.
parent b13b5860
......@@ -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;
/* 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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment