diff options
-rw-r--r-- | src/find-toolbar.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/find-toolbar.c b/src/find-toolbar.c index 31b5bc4..e0cbd54 100644 --- a/src/find-toolbar.c +++ b/src/find-toolbar.c @@ -212,10 +212,31 @@ failed_to_find_text_cb(WebKitFindController G_GNUC_UNUSED *find_controller, } static void +constructed(GObject *object) +{ + MqFindToolbar *find_toolbar; + + if (G_OBJECT_CLASS(mq_find_toolbar_parent_class)->constructed) { + G_OBJECT_CLASS(mq_find_toolbar_parent_class)->constructed( + object); + } + + find_toolbar = MQ_FIND_TOOLBAR(object); + + find_toolbar->find_controller = webkit_web_view_get_find_controller( + WEBKIT_WEB_VIEW(find_toolbar->web_view)); + g_signal_connect(find_toolbar->find_controller, "found-text", + G_CALLBACK(found_text_cb), find_toolbar); + g_signal_connect(find_toolbar->find_controller, "failed-to-find-text", + G_CALLBACK(failed_to_find_text_cb), find_toolbar); +} + +static void mq_find_toolbar_class_init(MqFindToolbarClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); + object_class->constructed = constructed; object_class->get_property = get_property; object_class->set_property = set_property; @@ -300,12 +321,6 @@ mq_find_toolbar_init(MqFindToolbar *find_toolbar) find_toolbar->match_case = FALSE; find_toolbar->searching = FALSE; - find_toolbar->find_controller = webkit_web_view_get_find_controller( - WEBKIT_WEB_VIEW(find_toolbar->web_view)); - g_signal_connect(find_toolbar->find_controller, "found-text", - G_CALLBACK(found_text_cb), find_toolbar); - g_signal_connect(find_toolbar->find_controller, "failed-to-find-text", - G_CALLBACK(failed_to_find_text_cb), find_toolbar); } GtkWidget * |