From 996ad39cc5bde753cb704b94a35b898ed73ae3bc Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 17 Sep 2017 00:24:55 -0400 Subject: load_progress_cb(), connect_web_view(): New functions --- (limited to 'src') diff --git a/src/tab-chrome.c b/src/tab-chrome.c index 7a97437..d71b5c1 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -87,8 +87,24 @@ mq_tab_chrome_get_container(MqTabChrome *chrome) return chrome->container; } +static void +load_progress_cb(WebKitWebView *web_view, + GParamSpec __attribute__((unused)) *paramspec, MqTabChrome *chrome) +{ + gtk_entry_set_progress_fraction(GTK_ENTRY(chrome->uri_entry), + webkit_web_view_get_estimated_load_progress(web_view)); +} + +static void +connect_web_view(MqTabChrome *chrome) +{ + g_signal_connect(chrome->web_view, "notify::estimated-load-progress", + G_CALLBACK(load_progress_cb), chrome); +} + void mq_tab_chrome_set_web_view(MqTabChrome *chrome, WebKitWebView *web_view) { chrome->web_view = web_view; + connect_web_view(chrome); } -- cgit v0.9.1