Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit317b472d544d2f825d7007202053d6fa521a4747 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-01-15 04:50:34 +0100
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-01-15 04:50:34 +0100
Files65bb050ab5c99935203b4f733e7f3d0b5babec98
goodwolf-317b472d544d2f825d7007202053d6fa521a4747.tar
goodwolf-317b472d544d2f825d7007202053d6fa521a4747.tar.gz
goodwolf-317b472d544d2f825d7007202053d6fa521a4747.zip
Parent008910b49b0686ac2cb165153d411703d887303a (diff)
badwolf.c: Add load progress information
1 files changed, 21 insertions, 0 deletions
-rw-r--r--badwolf.c21
diff --git a/badwolf.c b/badwolf.c
index aa18b24..a086af1 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -72,6 +72,23 @@ WebViewCb_notify__title(WebKitWebView *webView, GParamSpec *pspec, gpointer user
return TRUE;
}
+static gboolean WebViewCb_notify__estimated_load_progress(WebKitWebView *webView,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ struct Client *browser = (struct Client *)user_data;
+ gdouble progress;
+
+ progress = webkit_web_view_get_estimated_load_progress(browser->webView);
+ if(progress == 1)
+ {
+ progress = 0;
+ }
+ gtk_entry_set_progress_fraction(GTK_ENTRY(browser->location), progress);
+
+ return TRUE;
+}
+
static gboolean WebViewCb_mouse_target_changed(WebKitWebView *webView,
WebKitHitTestResult *hit,
guint modifiers,
@@ -134,6 +151,10 @@ int main(int argc, char *argv[])
"mouse-target-changed",
G_CALLBACK(WebViewCb_mouse_target_changed),
browser);
+ g_signal_connect(browser->webView,
+ "notify::estimated-load-progress",
+ G_CALLBACK(WebViewCb_notify__estimated_load_progress),
+ browser);
WebKitSettings *settings = webkit_web_view_get_settings(browser->webView);