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.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index de10dc3..4013c1b 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -207,6 +207,25 @@ title_cb(WebKitWebView __attribute__((unused)) *web_view,
}
static void
+loading_cb(WebKitWebView *web_view,
+ GParamSpec __attribute__((unused)) *paramspec, MqTabChrome *chrome)
+{
+ if (webkit_web_view_is_loading(web_view)) {
+ gtk_tool_button_set_icon_name(
+ GTK_TOOL_BUTTON(chrome->stop_reload_button),
+ "process-stop");
+ gtk_tool_button_set_label(
+ GTK_TOOL_BUTTON(chrome->stop_reload_button), "Stop");
+ } else {
+ gtk_tool_button_set_icon_name(
+ GTK_TOOL_BUTTON(chrome->stop_reload_button),
+ "view-refresh");
+ gtk_tool_button_set_label(
+ GTK_TOOL_BUTTON(chrome->stop_reload_button), "Reload");
+ }
+}
+
+static void
connect_web_view(MqTabChrome *chrome)
{
g_signal_connect(chrome->web_view, "load-changed",
@@ -220,6 +239,8 @@ connect_web_view(MqTabChrome *chrome)
G_CALLBACK(favicon_cb), chrome);
g_signal_connect(chrome->web_view, "notify::title",
G_CALLBACK(title_cb), chrome);
+ g_signal_connect(chrome->web_view, "notify::is-loading",
+ G_CALLBACK(loading_cb), chrome);
}
void