summaryrefslogtreecommitdiffstats
path: root/src/tab-chrome.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tab-chrome.c')
-rw-r--r--src/tab-chrome.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index d71b5c1..6671835 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -88,6 +88,24 @@ mq_tab_chrome_get_container(MqTabChrome *chrome)
}
static void
+load_changed_cb(WebKitWebView *web_view, WebKitLoadEvent load_event,
+ MqTabChrome *chrome)
+{
+ switch (load_event) {
+ case WEBKIT_LOAD_STARTED:
+ case WEBKIT_LOAD_REDIRECTED:
+ case WEBKIT_LOAD_COMMITTED:
+ gtk_entry_set_text(GTK_ENTRY(chrome->uri_entry),
+ webkit_web_view_get_uri(web_view));
+ break;
+ case WEBKIT_LOAD_FINISHED:
+ gtk_entry_set_progress_fraction(
+ GTK_ENTRY(chrome->uri_entry), 0.0);
+ break;
+ }
+}
+
+static void
load_progress_cb(WebKitWebView *web_view,
GParamSpec __attribute__((unused)) *paramspec, MqTabChrome *chrome)
{
@@ -98,6 +116,8 @@ load_progress_cb(WebKitWebView *web_view,
static void
connect_web_view(MqTabChrome *chrome)
{
+ g_signal_connect(chrome->web_view, "load-changed",
+ G_CALLBACK(load_changed_cb), chrome);
g_signal_connect(chrome->web_view, "notify::estimated-load-progress",
G_CALLBACK(load_progress_cb), chrome);
}