summaryrefslogtreecommitdiff
path: root/src/yelp-window.c
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2014-02-23 22:36:11 -0500
committerShaun McCance <shaunm@gnome.org>2014-02-23 22:36:11 -0500
commit0165e1053dd4061d3e337563cd46a5d116037649 (patch)
tree69056d6fc8cc348ceef7e662321c2c93e4872f24 /src/yelp-window.c
parentd1cf5410e0edaee67910b2408c1ff1b07edd9f2e (diff)
downloadyelp-0165e1053dd4061d3e337563cd46a5d116037649.tar.gz
Make prev/next buttons for find in page work
Diffstat (limited to 'src/yelp-window.c')
-rw-r--r--src/yelp-window.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/yelp-window.c b/src/yelp-window.c
index 7af8ac05..455ba152 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -118,6 +118,10 @@ static gboolean find_entry_key_press (GtkEntry *entry,
YelpWindow *window);
static void find_entry_changed (GtkEntry *entry,
YelpWindow *window);
+static void find_prev_clicked (GtkButton *button,
+ YelpWindow *window);
+static void find_next_clicked (GtkButton *button,
+ YelpWindow *window);
static void view_new_window (YelpView *view,
YelpUri *uri,
@@ -526,13 +530,13 @@ window_construct (YelpWindow *window)
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_style_context_add_class (gtk_widget_get_style_context (button), "raised");
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
- /* FIXME: signal_connect */
+ g_signal_connect (button, "clicked", G_CALLBACK (find_prev_clicked), window);
button = gtk_button_new_from_icon_name ("go-down-symbolic", GTK_ICON_SIZE_MENU);
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_style_context_add_class (gtk_widget_get_style_context (button), "raised");
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
- /* FIXME: signal_connect */
+ g_signal_connect (button, "clicked", G_CALLBACK (find_next_clicked), window);
gtk_widget_show_all (priv->find_bar);
@@ -1183,6 +1187,28 @@ find_entry_changed (GtkEntry *entry,
}
static void
+find_prev_clicked (GtkButton *button,
+ YelpWindow *window)
+{
+ YelpWindowPrivate *priv = GET_PRIV (window);
+ gchar *text = gtk_editable_get_chars (GTK_EDITABLE (priv->find_entry), 0, -1);
+ webkit_web_view_search_text (WEBKIT_WEB_VIEW (priv->view),
+ text, FALSE, FALSE, TRUE);
+ g_free (text);
+}
+
+static void
+find_next_clicked (GtkButton *button,
+ YelpWindow *window)
+{
+ YelpWindowPrivate *priv = GET_PRIV (window);
+ gchar *text = gtk_editable_get_chars (GTK_EDITABLE (priv->find_entry), 0, -1);
+ webkit_web_view_search_text (WEBKIT_WEB_VIEW (priv->view),
+ text, FALSE, TRUE, TRUE);
+ g_free (text);
+}
+
+static void
view_new_window (YelpView *view,
YelpUri *uri,
YelpWindow *window)