[dconf-editor] Rework keyboard handling.



commit 16073a4d47fe2858edb1835e1a835c552d20ef20
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Sep 26 15:59:11 2018 +0200

    Rework keyboard handling.

 editor/bookmarks.vala    |  39 +++++-
 editor/dconf-editor.vala |  32 ++++-
 editor/dconf-window.vala | 353 +++++++++++++++++++++++++++--------------------
 editor/pathbar.vala      |   2 +-
 editor/pathwidget.vala   |  11 ++
 5 files changed, 279 insertions(+), 158 deletions(-)
---
diff --git a/editor/bookmarks.vala b/editor/bookmarks.vala
index da62e38..8091eb5 100644
--- a/editor/bookmarks.vala
+++ b/editor/bookmarks.vala
@@ -36,6 +36,7 @@ private class Bookmarks : MenuButton
     private GLib.Settings settings;
 
     private HashTable<string, Bookmark> bookmarks_hashtable = new HashTable<string, Bookmark> (str_hash, 
str_equal);
+    private Bookmark? last_row = null;
 
     construct
     {
@@ -111,6 +112,38 @@ private class Bookmarks : MenuButton
     }
 
     // keyboard call
+    internal void down_pressed ()
+    {
+        ListBoxRow? row = bookmarks_list_box.get_selected_row ();
+        if (row == null)
+            row = bookmarks_list_box.get_row_at_index (0);
+        else
+            row = bookmarks_list_box.get_row_at_index (((!) row).get_index () + 1);
+
+        if (row == null)
+            return;
+        bookmarks_list_box.select_row ((!) row);
+        ((!) row).grab_focus ();
+    }
+    internal void up_pressed ()
+    {
+        ListBoxRow? row = bookmarks_list_box.get_selected_row ();
+        if (row == null)
+            row = last_row;
+        else
+        {
+            int index = ((!) row).get_index ();
+            if (index <= 0)
+                return;
+            row = bookmarks_list_box.get_row_at_index (index - 1);
+        }
+
+        if (row == null)
+            return;
+        bookmarks_list_box.select_row ((!) row);
+        ((!) row).grab_focus ();
+    }
+
     internal void bookmark_current_path ()
     {
         if (bookmarked_switch.get_active ())
@@ -239,12 +272,13 @@ private class Bookmarks : MenuButton
     private void update_bookmarks (Variant bookmarks_variant)
     {
         set_detailed_action_name ("ui.update-bookmarks-icons(" + bookmarks_variant.print (true) + ")");  // 
TODO disable action on popover closed
-        create_bookmark_rows (bookmarks_variant, enable_remove, ref bookmarks_list_box, ref 
bookmarks_hashtable);
+        create_bookmark_rows (bookmarks_variant, enable_remove, ref bookmarks_list_box, ref 
bookmarks_hashtable, ref last_row);
     }
-    private static void create_bookmark_rows (Variant bookmarks_variant, bool enable_remove, ref ListBox 
bookmarks_list_box, ref HashTable<string, Bookmark> bookmarks_hashtable)
+    private static void create_bookmark_rows (Variant bookmarks_variant, bool enable_remove, ref ListBox 
bookmarks_list_box, ref HashTable<string, Bookmark> bookmarks_hashtable, ref Bookmark? last_row)
     {
         bookmarks_list_box.@foreach ((widget) => widget.destroy ());
         bookmarks_hashtable.remove_all ();
+        last_row = null;
 
         string [] bookmarks = bookmarks_variant.get_strv ();
         string [] unduplicated_bookmarks = new string [0];
@@ -259,6 +293,7 @@ private class Bookmarks : MenuButton
             Bookmark bookmark_row = create_bookmark_row (bookmark, enable_remove);
             bookmarks_list_box.add (bookmark_row);
             bookmarks_hashtable.insert (bookmark, bookmark_row);
+            last_row = bookmark_row;
         }
         ListBoxRow? first_row = bookmarks_list_box.get_row_at_index (0);
         if (first_row != null)
diff --git a/editor/dconf-editor.vala b/editor/dconf-editor.vala
index 9548588..bca00bd 100644
--- a/editor/dconf-editor.vala
+++ b/editor/dconf-editor.vala
@@ -190,7 +190,7 @@ private class ConfigurationEditor : Gtk.Application
 "\n    " + _("example: “ca.desrt.dconf-editor.Settings”") +
 
 "\n  RELOC_SCHEMA" +
-/* Translators: no need to put your translation of "relocatable" between quotation marks, that's done to 
highlight why the option is called "RELOC_SCHEMA" */
+/* Translators: no need to put your translation of "relocatable" between quotation marks, that's done in 
English to highlight why the option is called "RELOC_SCHEMA" */
 "\n    " + _("the name of a “relocatable” schema, without fixed path") +
 "\n    " + _("see list with the “--list-relocatable-schemas” option") +
 
@@ -292,9 +292,33 @@ private class ConfigurationEditor : Gtk.Application
         Gtk.Window.set_default_icon_name ("ca.desrt.dconf-editor");
 
         add_action_entries (action_entries, this);
-        set_accels_for_action ("ui.copy-path",          { "<Primary><Shift>c" });
-        set_accels_for_action ("app.quit",              { "<Primary>q" });
-        set_accels_for_action ("app.apply-and-quit",    { "<Primary><Shift>q" });
+        set_accels_for_action ("kbd.toggle-bookmark",   {        "<Primary>b",
+                                                          "<Shift><Primary>b" });
+        set_accels_for_action ("kbd.copy-path",         { "<Shift><Primary>c" });
+        set_accels_for_action ("kbd.bookmark",          {        "<Primary>d" });
+        set_accels_for_action ("kbd.unbookmark",        { "<Shift><Primary>d" });
+        set_accels_for_action ("kbd.toggle-search",     {        "<Primary>f" });   // TODO 
<Shift><Primary>f something?
+        set_accels_for_action ("kbd.next-match",        {        "<Primary>g" });
+        set_accels_for_action ("kbd.previous-match",    { "<Shift><Primary>g" });
+        set_accels_for_action ("kbd.request-config",    {        "<Primary>i" });   // <Shift><Primary>i is 
gtk editor
+        set_accels_for_action ("kbd.modifications",     {        "<Alt>i"     });
+        set_accels_for_action ("kbd.edit-path-end",     {        "<Primary>l" });
+        set_accels_for_action ("kbd.edit-path-last",    { "<Shift><Primary>l" });
+        set_accels_for_action ("app.quit",              {        "<Primary>q" });
+        set_accels_for_action ("app.apply-and-quit",    { "<Shift><Primary>q" });
+
+        set_accels_for_action ("kbd.open-root",         { "<Shift><Alt>Up"    });
+        set_accels_for_action ("kbd.open-parent",       {        "<Alt>Up"    });
+        set_accels_for_action ("kbd.open-child",        {        "<Alt>Down"  });
+        set_accels_for_action ("kbd.open-last-child",   { "<Shift><Alt>Down"  });
+
+        set_accels_for_action ("kbd.set-to-default",    { "<Primary>Delete",
+                                                          "<Primary>KP_Delete",
+                                                          "<Primary>decimalpoint",
+                                                          "<Primary>period",
+                                                          "<Primary>KP_Decimal" }); // TODO "BackSpace"?
+        set_accels_for_action ("kbd.toggle-boolean",    { "<Primary>Return",
+                                                          "<Primary>KP_Enter"   });
 
         Gtk.CssProvider css_provider = new Gtk.CssProvider ();
         css_provider.load_from_resource ("/ca/desrt/dconf-editor/ui/dconf-editor.css");
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index e624f99..c429878 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -122,7 +122,8 @@ private class DConfWindow : ApplicationWindow
 
     internal DConfWindow (bool disable_warning, string? schema, string? path, string? key_name)
     {
-        install_action_entries ();
+        install_ui_action_entries ();
+        install_kbd_action_entries ();
 
         use_shortpaths_changed_handler = settings.changed ["use-shortpaths"].connect_after (reload_view);
         settings.bind ("use-shortpaths", model, "use-shortpaths", 
SettingsBindFlags.GET|SettingsBindFlags.NO_SENSITIVITY);
@@ -468,23 +469,23 @@ private class DConfWindow : ApplicationWindow
     }
 
     /*\
-    * * Action entries
+    * * Main UI action entries
     \*/
 
     private SimpleAction reload_search_action;
     private bool reload_search_next = true;
 
-    private void install_action_entries ()
+    private void install_ui_action_entries ()
     {
         SimpleActionGroup action_group = new SimpleActionGroup ();
-        action_group.add_action_entries (action_entries, this);
+        action_group.add_action_entries (ui_action_entries, this);
         insert_action_group ("ui", action_group);
 
         reload_search_action = (SimpleAction) action_group.lookup_action ("reload-search");
         reload_search_action.set_enabled (false);
     }
 
-    private const GLib.ActionEntry [] action_entries =
+    private const GLib.ActionEntry [] ui_action_entries =
     {
         { "empty", empty, "*" },
 
@@ -514,7 +515,6 @@ private class DConfWindow : ApplicationWindow
         { "dismiss-change", dismiss_change, "s" },  // here because needs to be accessed from 
DelayedSettingView rows
         { "erase", erase_dconf_key, "s" },          // here because needs a reload_view as we enter 
delay_mode
 
-        { "copy-path", copy_path },
         { "hide-notification", hide_notification }
     };
 
@@ -699,7 +699,54 @@ private class DConfWindow : ApplicationWindow
         invalidate_popovers_with_ui_reload ();
     }
 
-    private void copy_path (/* SimpleAction action, Variant? path_variant */)
+    private void hide_notification (/* SimpleAction action, Variant? variant */)
+    {
+        notification_revealer.set_reveal_child (false);
+    }
+
+    /*\
+    * * Keyboad action entries
+    \*/
+
+    private void install_kbd_action_entries ()
+    {
+        SimpleActionGroup action_group = new SimpleActionGroup ();
+        action_group.add_action_entries (kbd_action_entries, this);
+        insert_action_group ("kbd", action_group);
+    }
+
+    private const GLib.ActionEntry [] kbd_action_entries =
+    {
+        // keyboard calls
+        { "toggle-bookmark",    toggle_bookmark     },  // <P>b & <P>B
+        { "copy-path",          copy_path           },  // <P>C
+        { "bookmark",           bookmark            },  // <P>d
+        { "unbookmark",         unbookmark          },  // <P>D
+        { "toggle-search",      _toggle_search      },  // <P>f // TODO unduplicate names
+        { "next-match",         next_match          },  // <P>g // usual shortcut for "next-match"     in a 
SearchEntry; see also "Down"
+        { "previous-match",     previous_match      },  // <P>G // usual shortcut for "previous-match" in a 
SearchEntry; see also "Up"
+        { "request-config",     _request_config     },  // <P>i // TODO fusion with ui.open-config?
+        { "modifications",      modifications_list  },  // <A>i
+        { "edit-path-end",      edit_path_end       },  // <P>l
+        { "edit-path-last",     edit_path_last      },  // <P>L
+
+        { "open-root",          open_root           },  // <S><A>Up
+        { "open-parent",        open_current_parent },  //    <A>Up
+        { "open-child",         open_child          },  //    <A>Down
+        { "open-last-child",    open_last_child     },  // <S><A>Down
+
+        { "toggle-boolean",     toggle_boolean      },  // <P>Return & <P>KP_Enter
+        { "set-to-default",     set_to_default      }   // <P>Delete & <P>KP_Delete & decimalpoint & period 
& KP_Decimal
+    };
+
+    private void toggle_bookmark                        (/* SimpleAction action, Variant? variant */)
+    {
+        hide_hamburger_menu ();
+        browser_view.discard_row_popover ();
+        path_widget.click_bookmarks_button ();
+    }
+
+    private void copy_path                              (/* SimpleAction action, Variant? path_variant */)
     {
         browser_view.discard_row_popover ();
 
@@ -717,9 +764,130 @@ private class DConfWindow : ApplicationWindow
         }
     }
 
-    private void hide_notification (/* SimpleAction action, Variant? variant */)
+    private void bookmark                               (/* SimpleAction action, Variant? variant */)
     {
-        notification_revealer.set_reveal_child (false);
+        hide_hamburger_menu ();
+        browser_view.discard_row_popover ();
+        path_widget.bookmark_current_path ();
+    }
+
+    private void unbookmark                             (/* SimpleAction action, Variant? variant */)
+    {
+        hide_hamburger_menu ();
+        browser_view.discard_row_popover ();
+        path_widget.unbookmark_current_path ();
+    }
+
+    private void _toggle_search                         (/* SimpleAction action, Variant? variant */)
+    {
+        path_widget.close_popovers ();  // should never be needed if path_widget.search_mode_enabled
+        hide_hamburger_menu ();         // should never be needed if path_widget.search_mode_enabled
+        browser_view.discard_row_popover ();   // could be needed if path_widget.search_mode_enabled
+
+        if (!path_widget.search_mode_enabled)
+            request_search (true, PathEntry.SearchMode.SEARCH);
+        else if (!path_widget.entry_has_focus)
+            path_widget.entry_grab_focus ();
+        else if (path_widget.text.has_prefix ("/"))
+            request_search (true, PathEntry.SearchMode.SEARCH);
+        else
+            stop_search ();
+    }
+
+    private void next_match                             (/* SimpleAction action, Variant? variant */)   // 
See also "Down"
+    {
+        if (path_widget.has_popover ()) // only for bookmarks popover, but let pathwidget handle that
+            path_widget.down_pressed ();
+        else if (info_button.active == false && !revealer.get_modifications_list_state ())
+            browser_view.down_pressed ();               // FIXME returns bool
+    }
+
+    private void previous_match                         (/* SimpleAction action, Variant? variant */)   // 
See also "Up"
+    {
+        if (path_widget.has_popover ()) // only for bookmarks popover, but let pathwidget handle that
+            path_widget.up_pressed ();
+        else if (info_button.active == false && !revealer.get_modifications_list_state ())
+            browser_view.up_pressed ();                 // FIXME returns bool
+    }
+
+    private void _request_config                        (/* SimpleAction action, Variant? variant */)  // 
TODO unduplicate method name
+    {
+        if (browser_view.current_view == ViewType.FOLDER)
+            request_config (current_path);
+    }
+
+    private void modifications_list                     (/* SimpleAction action, Variant? variant */)
+    {
+        if (revealer.reveal_child)
+            revealer.toggle_modifications_list ();
+    }
+
+    private void edit_path_end                          (/* SimpleAction action, Variant? variant */)
+    {
+        if (!path_widget.search_mode_enabled)
+            request_search (true, PathEntry.SearchMode.EDIT_PATH_MOVE_END);
+    }
+
+    private void edit_path_last                         (/* SimpleAction action, Variant? variant */)
+    {
+        if (!path_widget.search_mode_enabled)
+            request_search (true, PathEntry.SearchMode.EDIT_PATH_SELECT_LAST_WORD);
+    }
+
+    private void open_root                              (/* SimpleAction action, Variant? variant */)
+    {
+        go_backward (true);
+    }
+
+    private void open_current_parent                    (/* SimpleAction action, Variant? variant */)
+    {
+        if (browser_view.current_view == ViewType.CONFIG)
+            request_folder (current_path);
+        else
+            go_backward (false);
+    }
+
+    private void open_child                             (/* SimpleAction action, Variant? variant */)
+    {
+        go_forward (false);
+    }
+
+    private void open_last_child                        (/* SimpleAction action, Variant? variant */)
+    {
+        go_forward (true);
+    }
+
+    private void toggle_boolean                         (/* SimpleAction action, Variant? variant */)
+    {
+        if (info_button.active || path_widget.has_popover ())
+            return;
+
+        browser_view.discard_row_popover ();
+        browser_view.toggle_boolean_key ();
+    }
+
+    private void set_to_default                         (/* SimpleAction action, Variant? variant */)
+    {
+        if (info_button.active || path_widget.has_popover ())
+            return;
+
+        if (revealer.dismiss_selected_modification ())
+        {
+            reload_view ();
+            return;
+        }
+        browser_view.discard_row_popover ();
+        string selected_row = browser_view.get_selected_row_name ();
+        if (selected_row.has_suffix ("/"))
+            reset_path ((!) selected_row, true);
+        else
+            browser_view.set_selected_to_default ();
+    }
+
+    private inline void hide_hamburger_menu ()
+    {
+        if (info_button.active)
+            info_button.active = false;
     }
 
     /*\
@@ -973,7 +1141,7 @@ private class DConfWindow : ApplicationWindow
     }
 
     [GtkCallback]
-    private bool on_key_press_event (Widget widget, Gdk.EventKey event)     // TODO better?
+    private bool on_key_press_event (Widget widget, Gdk.EventKey event)
     {
         uint keyval = event.keyval;
         string name = (!) (Gdk.keyval_name (keyval) ?? "");
@@ -985,20 +1153,12 @@ private class DConfWindow : ApplicationWindow
         {
             switch (name)
             {
-                case "b":
-                case "B":
-                    if (info_button.active)
-                        info_button.active = false;
-                    browser_view.discard_row_popover ();
-                    path_widget.click_bookmarks_button ();
-                    return true;
-
                 case "c":
-                    if (browser_view.current_view != ViewType.FOLDER)
-                        model.copy_action_called ();
-                    else if (focus_is_text_widget)
+                    if (focus_is_text_widget)
                         return false;
 
+                    model.copy_action_called ();
+
                     browser_view.discard_row_popover (); // TODO avoid duplicate get_selected_row () call
 
                     string? selected_row_text = browser_view.get_copy_text ();
@@ -1008,146 +1168,33 @@ private class DConfWindow : ApplicationWindow
                     application.copy (selected_row_text == null ? current_path : (!) selected_row_text);
                     return true;
 
-                case "d":
-                    if (info_button.active)
-                        info_button.active = false;
-                    browser_view.discard_row_popover ();
-                    path_widget.bookmark_current_path ();
-                    return true;
-                case "D":
-                    if (info_button.active)
-                        info_button.active = false;
-                    browser_view.discard_row_popover ();
-                    path_widget.unbookmark_current_path ();
-                    return true;
-
-                case "f":
-                    path_widget.close_popovers ();  // should never be needed if 
path_widget.search_mode_enabled
-                    if (info_button.active)         // should never happen if path_widget.search_mode_enabled
-                        info_button.active = false;
-                    browser_view.discard_row_popover ();   // could happen if path_widget.search_mode_enabled
-                    if (!path_widget.search_mode_enabled)
-                        request_search (true, PathEntry.SearchMode.SEARCH);
-                    else if (!path_widget.entry_has_focus)
-                        path_widget.entry_grab_focus ();
-                    else if (path_widget.text.has_prefix ("/"))
-                        request_search (true, PathEntry.SearchMode.SEARCH);
-                    else
-                        stop_search ();
-                    return true;
-
-                case "g":   // usual shortcut for "next-match" in a SearchEntry; see also "Down"
-                    if (!path_widget.has_popover ()
-                     && info_button.active == false
-                     && !revealer.get_modifications_list_state ())
-                        return browser_view.down_pressed ();
-                    return false;
-                case "G":   // usual shortcut for "previous-match" in a SearchEntry; see also "Up"
-                    if (!path_widget.has_popover ()
-                     && info_button.active == false
-                     && !revealer.get_modifications_list_state ())
-                        return browser_view.up_pressed ();
-                    return false;
-
-                case "i": 
-                    if (browser_view.current_view == ViewType.FOLDER)
-                        request_config (current_path);
-                    return true;
-
-                case "l":
-                    if (path_widget.search_mode_enabled)
+                case "v":   // https://bugzilla.gnome.org/show_bug.cgi?id=762257 is WONTFIX // TODO 
<Shift><Primary>v something?
+                    if (focus_is_text_widget)
                         return false;
-                    request_search (true, PathEntry.SearchMode.EDIT_PATH_MOVE_END);
-                    return true;
-                case "L":
-                    if (path_widget.search_mode_enabled)
+
+                    Gdk.Display? display = Gdk.Display.get_default ();
+                    if (display == null)    // ?
                         return false;
-                    request_search (true, PathEntry.SearchMode.EDIT_PATH_SELECT_LAST_WORD);
+
+                    string? clipboard_content = Clipboard.get_default ((!) display).wait_for_text ();
+                    if (clipboard_content != null)
+                        request_search (true, PathEntry.SearchMode.EDIT_PATH_MOVE_END, clipboard_content);
+                    else
+                        request_search (true, PathEntry.SearchMode.SEARCH);
                     return true;
 
-                case "v":   // https://bugzilla.gnome.org/show_bug.cgi?id=762257 is WONTFIX
-                    if (!focus_is_text_widget)
-                    {
-                        Gdk.Display? display = Gdk.Display.get_default ();
-                        if (display == null)    // ?
-                            return false;
-                        string? clipboard_content = Clipboard.get_default ((!) display).wait_for_text ();
-                        if (clipboard_content != null)
-                            request_search (true, PathEntry.SearchMode.EDIT_PATH_MOVE_END, 
clipboard_content);
-                        else
-                            request_search (true, PathEntry.SearchMode.SEARCH);
-                        return true;
-                    }
-                    return false;
-
-                case "F1":
+                case "F1":  // TODO dance done to avoid <Primary>F1 to show help overlay
                     browser_view.discard_row_popover ();
                     if ((event.state & Gdk.ModifierType.SHIFT_MASK) == 0)
                         return false;   // help overlay
                     ((ConfigurationEditor) get_application ()).about_cb ();
                     return true;
 
-                case "Return":
-                case "KP_Enter":
-                    if (info_button.active || path_widget.has_popover ())
-                        return false;
-                    browser_view.discard_row_popover ();
-                    browser_view.toggle_boolean_key ();
-                    return true;
-
-                // case "BackSpace":    // ?
-                case "Delete":
-                case "KP_Delete":
-                case "decimalpoint":
-                case "period":
-                case "KP_Decimal":
-                    if (info_button.active || path_widget.has_popover ())
-                        return false;
-                    if (revealer.dismiss_selected_modification ())
-                    {
-                        reload_view ();
-                        return true;
-                    }
-                    browser_view.discard_row_popover ();
-                    string selected_row = browser_view.get_selected_row_name ();
-                    if (selected_row.has_suffix ("/"))
-                        reset_path ((!) selected_row, true);
-                    else
-                        browser_view.set_selected_to_default ();
-                    return true;
-
                 default:
                     break;
             }
         }
 
-        if ((event.state & Gdk.ModifierType.MOD1_MASK) != 0)
-        {
-            if (name == "i")
-            {
-                if (revealer.reveal_child)
-                {
-                    revealer.toggle_modifications_list ();
-                    return true;
-                }
-                return false;
-            }
-            if (name == "Up")
-            {
-                bool shift = (event.state & Gdk.ModifierType.SHIFT_MASK) != 0;
-                if (!shift && browser_view.current_view == ViewType.CONFIG)
-                    request_folder (current_path);
-                else
-                    go_backward (shift);
-                return true;
-            }
-            if (name == "Down")
-            {
-                go_forward ((event.state & Gdk.ModifierType.SHIFT_MASK) != 0);
-                return true;
-            }
-        }
-
         /* don't use "else if", or some widgets will not be hidden on <ctrl>F10 or such things */
         if (name == "F10")
         {
@@ -1166,12 +1213,16 @@ private class DConfWindow : ApplicationWindow
             return false;
         }
 
-        if (name == "Up"    // see also <ctrl>G
+        if (name == "Up"
+         && (event.state & Gdk.ModifierType.MOD1_MASK) == 0
+         // see also <ctrl>G
          && !path_widget.has_popover ()
          && info_button.active == false
          && !revealer.get_modifications_list_state ())
             return browser_view.up_pressed ();
-        if (name == "Down"  // see also <ctrl>g
+        if (name == "Down"
+         && (event.state & Gdk.ModifierType.MOD1_MASK) == 0
+         // see also <ctrl>g
          && !path_widget.has_popover ()
          && info_button.active == false
          && !revealer.get_modifications_list_state ())
@@ -1206,8 +1257,7 @@ private class DConfWindow : ApplicationWindow
             if (browser_view.toggle_row_popover ())
             {
                 path_widget.close_popovers ();
-                if (info_button.active)
-                    info_button.active = false;
+                hide_hamburger_menu ();
             }
             else if (info_button.sensitive == false)
                 return true;
@@ -1222,7 +1272,7 @@ private class DConfWindow : ApplicationWindow
             return true;
         }
 
-        if (path_widget.has_popover () || info_button.active)
+        if (info_button.active || path_widget.has_popover ())
             return false;
 
         if (!path_widget.search_mode_enabled &&
@@ -1263,6 +1313,7 @@ private class DConfWindow : ApplicationWindow
         else
             request_folder (ModelUtils.get_parent_path (current_path), current_path.dup ());
     }
+
     private void go_forward (bool shift)
     {
         if (path_widget.search_mode_enabled)
diff --git a/editor/pathbar.vala b/editor/pathbar.vala
index 6ac92b9..38cd3df 100644
--- a/editor/pathbar.vala
+++ b/editor/pathbar.vala
@@ -387,7 +387,7 @@ private class PathBarItem : Button
     private void generate_popover ()
     {
         GLib.Menu menu = new GLib.Menu ();
-        menu.append (_("Copy current path"), "ui.copy-path"); // or "app.copy(\"" + get_action_target_value 
().get_string () + "\")"
+        menu.append (_("Copy current path"), "kbd.copy-path"); // or "app.copy(\"" + get_action_target_value 
().get_string () + "\")"
         menu.freeze ();
 
         popover = new Popover.from_model (this, (MenuModel) menu);
diff --git a/editor/pathwidget.vala b/editor/pathwidget.vala
index a2410f7..9326737 100644
--- a/editor/pathwidget.vala
+++ b/editor/pathwidget.vala
@@ -101,6 +101,17 @@ private class PathWidget : Box
         return false;
     }
 
+    internal void down_pressed ()
+    {
+        if (bookmarks_button.active)
+            bookmarks_button.down_pressed ();
+    }
+    internal void up_pressed ()
+    {
+        if (bookmarks_button.active)
+            bookmarks_button.up_pressed ();
+    }
+
     /* path bar */
     internal string complete_path { get { return pathbar.complete_path; }}
 


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