Fallback midori_view_search_text to overlay

This commit is contained in:
Christian Dywan 2012-03-31 03:33:00 +02:00
parent 3e0dc32017
commit 79942f24aa
3 changed files with 29 additions and 1 deletions

View file

@ -5593,6 +5593,15 @@ midori_view_search_text (MidoriView* view,
{ {
g_return_if_fail (MIDORI_IS_VIEW (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, g_signal_emit (view, signals[SEARCH_TEXT], 0,
webkit_web_view_search_text (WEBKIT_WEB_VIEW (view->web_view), webkit_web_view_search_text (WEBKIT_WEB_VIEW (view->web_view),
text, case_sensitive, forward, TRUE), NULL); text, case_sensitive, forward, TRUE), NULL);

View file

@ -145,6 +145,22 @@ midori_findbar_find_text (MidoriFindbar* findbar,
midori_view_search_text (MIDORI_VIEW (view), text, case_sensitive, forward); 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 void
midori_findbar_find (MidoriFindbar* findbar, midori_findbar_find (MidoriFindbar* findbar,
gboolean forward) gboolean forward)

View file

@ -1,5 +1,5 @@
/* /*
Copyright (C) 2010 Christian Dywan <christian@twotoasts.de> Copyright (C) 2012 Christian Dywan <christian@twotoasts.de>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
@ -47,6 +47,9 @@ midori_findbar_find_text (MidoriFindbar* findbar,
const gchar* text, const gchar* text,
gboolean forward); gboolean forward);
const gchar*
midori_findbar_get_text (MidoriFindbar* findbar);
void void
midori_findbar_set_can_find (MidoriFindbar* findbar, midori_findbar_set_can_find (MidoriFindbar* findbar,
gboolean can_find); gboolean can_find);