[nautilus/gtk4-preparation-trunk: 5/60] window: Use F10 for current location menu




commit 1f435dcb8e9e992bd18d1acd0b369b0918a03ed2
Author: António Fernandes <antoniof gnome org>
Date:   Sat Jul 28 12:06:20 2018 +0100

    window: Use F10 for current location menu
    
    This menu is closer to the classic "File" menu, and it the actual
    "secondary menu" design pattern of this window.

 src/nautilus-pathbar.c |  2 +-
 src/nautilus-pathbar.h |  1 +
 src/nautilus-window.c  | 16 +++++++++++++++-
 3 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index f036cf68f..9d1b3e911 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -559,7 +559,7 @@ nautilus_path_bar_clear_buttons (NautilusPathBar *self)
     }
 }
 
-static void
+void
 nautilus_path_bar_show_current_location_menu (NautilusPathBar *self)
 {
     g_return_if_fail (NAUTILUS_IS_PATH_BAR (self));
diff --git a/src/nautilus-pathbar.h b/src/nautilus-pathbar.h
index d70b71572..1052e4d2d 100644
--- a/src/nautilus-pathbar.h
+++ b/src/nautilus-pathbar.h
@@ -31,3 +31,4 @@ void     nautilus_path_bar_set_extensions_background_menu (NautilusPathBar *path
                                                            GMenuModel      *menu);
 void     nautilus_path_bar_set_templates_menu             (NautilusPathBar *path_bar,
                                                            GMenuModel      *menu);
+void     nautilus_path_bar_show_current_location_menu     (NautilusPathBar *path_bar);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index f052de77b..c26f6f2ff 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -440,6 +440,19 @@ action_toggle_state_view_button (GSimpleAction *action,
     g_variant_unref (current_state);
 }
 
+static void
+action_show_current_location_menu (GSimpleAction *action,
+                                   GVariant      *state,
+                                   gpointer       user_data)
+{
+    NautilusWindow *window = user_data;
+    GtkWidget *path_bar;
+
+    path_bar = nautilus_toolbar_get_path_bar (NAUTILUS_TOOLBAR (window->toolbar));
+
+    nautilus_path_bar_show_current_location_menu (NAUTILUS_PATH_BAR (path_bar));
+}
+
 static void
 on_location_changed (NautilusWindow *window)
 {
@@ -2005,6 +2018,7 @@ const GActionEntry win_entries[] =
     { "forward", action_forward },
     { "up", action_up },
     { "view-menu", action_toggle_state_view_button, NULL, "false", NULL },
+    { "current-location-menu", action_show_current_location_menu },
     { "reload", action_reload },
     { "stop", action_stop },
     { "new-tab", action_new_tab },
@@ -2070,7 +2084,7 @@ nautilus_window_initialize_actions (NautilusWindow *window)
     nautilus_application_set_accelerators (app, "win.prompt-root-location", ACCELS ("slash", "KP_Divide"));
     /* Support keyboard layouts which have a dead tilde key but not a tilde key. */
     nautilus_application_set_accelerators (app, "win.prompt-home-location", ACCELS ("asciitilde", 
"dead_tilde"));
-    nautilus_application_set_accelerator (app, "win.view-menu", "F10");
+    nautilus_application_set_accelerator (app, "win.current-location-menu", "F10");
     nautilus_application_set_accelerator (app, "win.restore-tab", "<shift><control>t");
 
     /* Alt+N for the first 9 tabs */


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