[Xfce4-commits] <midori:master> Implement basic inline search with WebKit2

Christian Dywan noreply at xfce.org
Mon Apr 1 17:36:01 CEST 2013


Updating branch refs/heads/master
         to 0bd1a896073715ff235ae433581b936f7420ae67 (commit)
       from c6c428790323cfede59a125966b826a46cd13a2a (commit)

commit 0bd1a896073715ff235ae433581b936f7420ae67
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Apr 1 17:11:01 2013 +0200

    Implement basic inline search with WebKit2

 midori/midori-tab.vala |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/midori/midori-tab.vala b/midori/midori-tab.vala
index 1509452..fd300e8 100644
--- a/midori/midori-tab.vala
+++ b/midori/midori-tab.vala
@@ -224,14 +224,22 @@ namespace Midori {
         }
 
         public bool find (string text, bool case_sensitive, bool forward) {
-#if !HAVE_WEBKIT2
+#if HAVE_WEBKIT2
+            var controller = web_view.get_find_controller ();
+            uint options = WebKit.FindOptions.WRAP_AROUND;
+            if (!case_sensitive)
+                options += WebKit.FindOptions.CASE_INSENSITIVE;
+            if (!forward)
+                options += WebKit.FindOptions.BACKWARDS;
+            controller.search (text, options, 0);
+            // FIXME: mark matches, count matches, not found
+            return true;
+#else
             bool found = false;
             found = web_view.search_text (text, case_sensitive, forward, true);
             web_view.mark_text_matches (text, case_sensitive, 0);
             web_view.set_highlight_text_matches (true);
             return found;
-#else
-            return false;
 #endif
         }
     }


More information about the Xfce4-commits mailing list