[dconf-editor] Some keyboard fixes.



commit 8bf791563872688558c58834c57e56045bcdba57
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Dec 11 06:49:33 2017 +0100

    Some keyboard fixes.

 editor/dconf-editor.ui       |    2 --
 editor/dconf-window.vala     |   16 +++++++---------
 editor/key-list-box-row.vala |    5 +++++
 editor/registry-search.vala  |    4 ++++
 editor/registry-view.vala    |    4 ++++
 5 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/editor/dconf-editor.ui b/editor/dconf-editor.ui
index 980ee49..1d44136 100644
--- a/editor/dconf-editor.ui
+++ b/editor/dconf-editor.ui
@@ -31,7 +31,6 @@
             <property name="focus-on-click">False</property>
             <property name="sensitive" bind-source="search-toggle" bind-property="active" 
bind-flags="sync-create|invert-boolean"/>
             <accelerator key="F10" signal="clicked"/> <!-- TODO report bug: property binding has to be 
defined before accelerator -->
-            <signal name="clicked" handler="on_menu_button_clicked"/>
             <style>
               <class name="image-button"/>
             </style>
@@ -89,7 +88,6 @@
             <property name="focus-on-click">False</property>
             <property name="schema-id">ca.desrt.dconf-editor.Settings</property>
             <property name="sensitive" bind-source="search-toggle" bind-property="active" 
bind-flags="sync-create|invert-boolean"/>
-            <signal name="clicked" handler="on_menu_button_clicked"/>
             <signal name="request_path" handler="request_path"/>
             <!-- <accelerator key="B" signal="activate" modifiers="GDK_CONTROL_MASK"/> TODO -->
             <style>
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 20a8afa..cac79da 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -560,9 +560,13 @@ class DConfWindow : ApplicationWindow
             return false;
         }
 
-        if (name == "Up")
+        if (name == "Up"
+         && bookmarks_button.active == false
+         && info_button.active == false)
             return browser_view.up_pressed (!search_bar.get_search_mode ());
-        if (name == "Down")
+        if (name == "Down"
+         && bookmarks_button.active == false
+         && info_button.active == false)
             return browser_view.down_pressed (!search_bar.get_search_mode ());
 
         if ((name == "Return" || name == "KP_Enter")
@@ -587,6 +591,7 @@ class DConfWindow : ApplicationWindow
             {
                 if (bookmarks_button.active)
                     bookmarks_button.active = false;
+                browser_view.discard_row_popover ();
                 info_button.active = true;
             }
             else
@@ -600,13 +605,6 @@ class DConfWindow : ApplicationWindow
         return false;    // browser_view.handle_search_event (event);
     }
 
-    [GtkCallback]
-    private void on_menu_button_clicked ()
-    {
-        browser_view.discard_row_popover ();
-//        browser_view.set_search_mode (false);
-    }
-
     private void go_backward (bool shift)
     {
         if (current_path == "/")
diff --git a/editor/key-list-box-row.vala b/editor/key-list-box-row.vala
index d2575a9..6a96e06 100644
--- a/editor/key-list-box-row.vala
+++ b/editor/key-list-box-row.vala
@@ -113,6 +113,11 @@ private abstract class ClickableListBoxRow : EventBox
             ((!) nullable_popover).popdown ();
     }
 
+    public bool right_click_popover_visible ()
+    {
+        return (nullable_popover != null) && (((!) nullable_popover).visible);
+    }
+
     public void show_right_click_popover (ModificationsHandler modifications_handler, int event_x = (int) 
(get_allocated_width () / 2.0))
     {
         if (nullable_popover == null)
diff --git a/editor/registry-search.vala b/editor/registry-search.vala
index cc12b88..117aef3 100644
--- a/editor/registry-search.vala
+++ b/editor/registry-search.vala
@@ -242,6 +242,10 @@ class RegistrySearch : Grid, PathElement, BrowsableView
 
         if (selected_row != null)
         {
+            Widget? row_content = ((!) selected_row).get_child ();
+            if (row_content != null && ((ClickableListBoxRow) (!) row_content).right_click_popover_visible 
())
+                return false;
+
             int position = ((!) selected_row).get_index ();
             ListBoxRow? row = null;
             if (!is_down && (position >= 1))
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index 29d96bf..9f511c4 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -223,6 +223,10 @@ class RegistryView : Grid, PathElement, BrowsableView
 
         if (selected_row != null)
         {
+            Widget? row_content = ((!) selected_row).get_child ();
+            if (row_content != null && ((ClickableListBoxRow) (!) row_content).right_click_popover_visible 
())
+                return false;
+
             int position = ((!) selected_row).get_index ();
             ListBoxRow? row = null;
             if (!is_down && (position >= 1))


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