[dconf-editor] Special case root for search, part 2.



commit 28718a76721fed7e1cb96e4c93d0566b09e57e8a
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Jan 5 14:20:41 2019 +0100

    Special case root for search, part 2.
    
    The root path does not have a "local search" functionality, as
    that would be similar to the "global search" and so, confusing
    as hell. Instead, use an "Open path entry" functionality for a
    better discoverability of this function (part 1), and make the
    search buttons open for there the search entry empty (part 2).

 editor/browser-window.vala | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/editor/browser-window.vala b/editor/browser-window.vala
index eb70c20..e8e2917 100644
--- a/editor/browser-window.vala
+++ b/editor/browser-window.vala
@@ -247,7 +247,10 @@ private abstract class BrowserWindow : BaseWindow
     private void show_search (/* SimpleAction action, Variant? path_variant */)
     {
         init_next_search = true;
-        request_search (PathEntry.SearchMode.EDIT_PATH_SELECT_ALL);
+        if (current_path == "/")
+            request_search (PathEntry.SearchMode.SEARCH);
+        else
+            request_search (PathEntry.SearchMode.EDIT_PATH_SELECT_ALL);
     }
 
     private void toggle_search (SimpleAction action, Variant? path_variant)
@@ -258,7 +261,10 @@ private abstract class BrowserWindow : BaseWindow
         if (search_request && !headerbar.search_mode_enabled)
         {
             init_next_search = true;
-            request_search (PathEntry.SearchMode.EDIT_PATH_SELECT_ALL);
+            if (current_path == "/")
+                request_search (PathEntry.SearchMode.SEARCH);
+            else
+                request_search (PathEntry.SearchMode.EDIT_PATH_SELECT_ALL);
         }
         else if (!search_request && headerbar.search_mode_enabled)
             stop_search ();


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