[dconf-editor] Focus row when going back to browse view.



commit b41f9c3f84f55b09abc3e1d46abe36da222ca3c1
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Sat Dec 2 12:14:56 2017 +0100

    Focus row when going back to browse view.

 editor/browser-view.vala  |    3 +++
 editor/registry-view.vala |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/editor/browser-view.vala b/editor/browser-view.vala
index 1947e10..618938c 100644
--- a/editor/browser-view.vala
+++ b/editor/browser-view.vala
@@ -164,6 +164,9 @@ class BrowserView : Grid, PathElement
             stack.set_transition_type (StackTransitionType.NONE);
             stack.visible_child = (!) pre_search_view;
             pre_search_view = null;
+
+            if (stack.get_visible_child () == browse_view)
+                browse_view.focus_selected_row ();
         }
         search_results_view.stop_search ();
     }
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index 576aa64..0fc96fa 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -76,6 +76,12 @@ class RegistryView : Grid, PathElement, BrowsableView
         multiple_schemas_warning_revealer.set_reveal_child (multiple_schemas_warning_needed);
     }
 
+    public void focus_selected_row ()
+    {
+        ListBoxRow? selected_row = key_list_box.get_selected_row ();
+        if (selected_row != null)
+            ((!) selected_row).grab_focus ();
+    }
     public void select_row_named (string selected, bool grab_focus)
     {
         check_resize ();


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