[geary/wip/search-cleanup: 2/5] Ensure conversation find entry focused when visble and shortcut invoked



commit 699594711d9ae111b516bea7627aa4a3ad9a4156
Author: Michael Gratton <mike vee net>
Date:   Mon Feb 4 22:35:00 2019 +1100

    Ensure conversation find entry focused when visble and shortcut invoked

 src/client/application/geary-controller.vala            | 2 +-
 src/client/conversation-viewer/conversation-viewer.vala | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index 904a7983..64185fd6 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -2273,7 +2273,7 @@ public class GearyController : Geary.BaseObject {
     }
 
     private void on_find_in_conversation_action(SimpleAction action) {
-        this.main_window.conversation_viewer.conversation_find_bar.set_search_mode(true);
+        this.main_window.conversation_viewer.enable_find();
     }
 
     private void on_search_activated(SimpleAction action) {
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index 51be6b4b..46f1a294 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -220,6 +220,12 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
         set_visible_child(this.empty_search_page);
     }
 
+    /** Shows and focuses the find entry. */
+    public void enable_find() {
+        this.conversation_find_bar.set_search_mode(true);
+        this.conversation_find_entry.grab_focus();
+    }
+
     /**
      * Shows a conversation in the viewer.
      */


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