diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-23 04:49:16 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-23 04:49:16 (EDT) |
commit | fa40eacfcfb176a91f777cf8f3c29fd692a7f369 (patch) | |
tree | 71d6e6e1f001d976decbc82adf815fc57620b8b6 /src | |
parent | ad8f6a1b17a145f6465a3ffbd4e5b71ff1de2fff (diff) | |
download | marquee-fa40eacfcfb176a91f777cf8f3c29fd692a7f369.zip marquee-fa40eacfcfb176a91f777cf8f3c29fd692a7f369.tar.gz marquee-fa40eacfcfb176a91f777cf8f3c29fd692a7f369.tar.bz2 |
MqWebView: Use mq_notebook_insert_child()
Diffstat (limited to 'src')
-rw-r--r-- | src/web-view.c | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/src/web-view.c b/src/web-view.c index 93e9062..f4b6eab 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -29,6 +29,7 @@ #include <webkit2/webkit2.h> #include "config.h" +#include "notebook.h" #include "tab-page.h" struct _MqWebView { @@ -69,9 +70,11 @@ static void menu_open_link_tab_activate_cb(GtkAction G_GNUC_UNUSED *action, MqWebView *web_view) { - /* TODO: Use MqNotebook function. */ - mq_tab_page_new(mq_tab_page_get_window(web_view->tab_page), - webkit_hit_test_result_get_link_uri(web_view->hit_test_result)); + mq_notebook_insert_child( + MQ_NOTEBOOK(gtk_widget_get_parent( + GTK_WIDGET(web_view->tab_page))), + webkit_hit_test_result_get_link_uri(web_view->hit_test_result), + web_view->tab_page); } static void @@ -99,10 +102,11 @@ static void menu_open_image_tab_activate_cb(GtkAction G_GNUC_UNUSED *action, MqWebView *web_view) { - /* TODO: Use MqNotebook function. */ - mq_tab_page_new(mq_tab_page_get_window(web_view->tab_page), - webkit_hit_test_result_get_image_uri( - web_view->hit_test_result)); + mq_notebook_insert_child( + MQ_NOTEBOOK(gtk_widget_get_parent( + GTK_WIDGET(web_view->tab_page))), + webkit_hit_test_result_get_image_uri(web_view->hit_test_result), + web_view->tab_page); } static void @@ -130,10 +134,11 @@ static void menu_open_video_tab_activate_cb(GtkAction G_GNUC_UNUSED *action, MqWebView *web_view) { - /* TODO: Use MqNotebook function. */ - mq_tab_page_new(mq_tab_page_get_window(web_view->tab_page), - webkit_hit_test_result_get_media_uri( - web_view->hit_test_result)); + mq_notebook_insert_child( + MQ_NOTEBOOK(gtk_widget_get_parent( + GTK_WIDGET(web_view->tab_page))), + webkit_hit_test_result_get_media_uri(web_view->hit_test_result), + web_view->tab_page); } static void @@ -161,10 +166,11 @@ static void menu_open_audio_tab_activate_cb(GtkAction G_GNUC_UNUSED *action, MqWebView *web_view) { - /* TODO: Use MqNotebook function. */ - mq_tab_page_new(mq_tab_page_get_window(web_view->tab_page), - webkit_hit_test_result_get_media_uri( - web_view->hit_test_result)); + mq_notebook_insert_child( + MQ_NOTEBOOK(gtk_widget_get_parent( + GTK_WIDGET(web_view->tab_page))), + webkit_hit_test_result_get_media_uri(web_view->hit_test_result), + web_view->tab_page); } static void @@ -531,9 +537,11 @@ button_press_cb(GtkWidget *widget, GdkEventButton *event) hit_test_result = web_view->mouse_target_hit_test_result; if (webkit_hit_test_result_context_is_link(hit_test_result)) { - /* TODO: Use MqNotebook function. */ - mq_tab_page_new(mq_tab_page_get_window(web_view->tab_page), - webkit_hit_test_result_get_link_uri(hit_test_result)); + mq_notebook_insert_child( + MQ_NOTEBOOK(gtk_widget_get_parent( + GTK_WIDGET(web_view->tab_page))), + webkit_hit_test_result_get_link_uri(hit_test_result), + web_view->tab_page); } else if (webkit_hit_test_result_context_is_editable(hit_test_result)){ /* Let WebKit handle pasting from the primary clipboard into an * editable element. */ |