[Xfce4-commits] <midori:master> Fallback midori_view_search_text to overlay

Christian Dywan noreply at xfce.org
Sat Mar 31 05:50:01 CEST 2012


Updating branch refs/heads/master
         to 79942f24aa1337afafa0359b3d7ef2daa14f7268 (commit)
       from 3e0dc32017b84b2c4b7a91445894b8eab7e2ef02 (commit)

commit 79942f24aa1337afafa0359b3d7ef2daa14f7268
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Mar 31 03:33:00 2012 +0200

    Fallback midori_view_search_text to overlay

 midori/midori-view.c      |    9 +++++++++
 toolbars/midori-findbar.c |   16 ++++++++++++++++
 toolbars/midori-findbar.h |    5 ++++-
 3 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index e985aec..6d392f7 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -5593,6 +5593,15 @@ midori_view_search_text (MidoriView*  view,
 {
     g_return_if_fail (MIDORI_IS_VIEW (view));
 
+    #if GTK_CHECK_VERSION (3, 2, 0)
+    if (gtk_widget_get_visible (view->overlay_find))
+    {
+        text = midori_findbar_get_text (MIDORI_FINDBAR (view->overlay_find));
+        webkit_web_view_search_text (WEBKIT_WEB_VIEW (view->web_view),
+            text, case_sensitive, forward, TRUE);
+        return;
+    }
+    #endif
     g_signal_emit (view, signals[SEARCH_TEXT], 0,
         webkit_web_view_search_text (WEBKIT_WEB_VIEW (view->web_view),
             text, case_sensitive, forward, TRUE), NULL);
diff --git a/toolbars/midori-findbar.c b/toolbars/midori-findbar.c
index 22ab5da..6ef47f2 100644
--- a/toolbars/midori-findbar.c
+++ b/toolbars/midori-findbar.c
@@ -145,6 +145,22 @@ midori_findbar_find_text (MidoriFindbar* findbar,
     midori_view_search_text (MIDORI_VIEW (view), text, case_sensitive, forward);
 }
 
+/**
+ * midori_findbar_get_text:
+ * @findbar: #MidoriFindbar
+ *
+ * Returns: the text typed in the entry
+ *
+ * Since: 0.4.5
+ **/
+const gchar*
+midori_findbar_get_text (MidoriFindbar* findbar)
+{
+    g_return_val_if_fail (MIDORI_IS_FINDBAR (findbar), NULL);
+
+    return gtk_entry_get_text (GTK_ENTRY (findbar->find_text));
+}
+
 void
 midori_findbar_find (MidoriFindbar* findbar,
                      gboolean       forward)
diff --git a/toolbars/midori-findbar.h b/toolbars/midori-findbar.h
index 5f1a54c..7a7ea19 100644
--- a/toolbars/midori-findbar.h
+++ b/toolbars/midori-findbar.h
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2010 Christian Dywan <christian at twotoasts.de>
+ Copyright (C) 2012 Christian Dywan <christian at twotoasts.de>
 
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
@@ -47,6 +47,9 @@ midori_findbar_find_text              (MidoriFindbar* findbar,
                                        const gchar*   text,
                                        gboolean       forward);
 
+const gchar*
+midori_findbar_get_text                (MidoriFindbar* findbar);
+
 void
 midori_findbar_set_can_find           (MidoriFindbar* findbar,
                                        gboolean       can_find);


More information about the Xfce4-commits mailing list