diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-09-17 03:52:26 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-09-17 03:52:26 (EDT) |
commit | 709fb30f17877ab4db6adf88e5a6b9fa537ac38e (patch) | |
tree | b196880ebc80c0dbe56740008262ffd655d68be3 /src | |
parent | 86117c86ed80b6d660258045a680f89a46b0f9d5 (diff) | |
download | marquee-709fb30f17877ab4db6adf88e5a6b9fa537ac38e.zip marquee-709fb30f17877ab4db6adf88e5a6b9fa537ac38e.tar.gz marquee-709fb30f17877ab4db6adf88e5a6b9fa537ac38e.tar.bz2 |
src/tab-chrome.[ch]: Add stop/reload button
Currently just reloads.
Diffstat (limited to 'src')
-rw-r--r-- | src/tab-chrome.c | 14 | ||||
-rw-r--r-- | src/tab-chrome.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c index 2808b3f..90309a6 100644 --- a/src/tab-chrome.c +++ b/src/tab-chrome.c @@ -41,6 +41,13 @@ forward_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton, } static void +stop_reload_clicked_cb(GtkToolButton __attribute__((unused)) *toolbutton, + MqTabChrome *chrome) +{ + webkit_web_view_reload(chrome->web_view); +} + +static void uri_activate_cb(GtkEntry *entry, MqTabChrome *chrome) { webkit_web_view_load_uri(chrome->web_view, @@ -69,6 +76,13 @@ navigation_toolbar_new(MqTabChrome *chrome, gchar *uri) G_CALLBACK(forward_clicked_cb), chrome); gtk_toolbar_insert(navigation_toolbar, chrome->forward_button, -1); + /* Stop/reload button */ + chrome->stop_reload_button = gtk_tool_button_new( + gtk_image_new_from_icon_name("view-refresh", 16), "Reload"); + g_signal_connect(chrome->stop_reload_button, "clicked", + G_CALLBACK(stop_reload_clicked_cb), chrome); + gtk_toolbar_insert(navigation_toolbar, chrome->stop_reload_button, -1); + /* URI bar */ uri_toolitem = gtk_tool_item_new(); chrome->uri_entry = gtk_entry_new(); diff --git a/src/tab-chrome.h b/src/tab-chrome.h index 3d08cad..3785a95 100644 --- a/src/tab-chrome.h +++ b/src/tab-chrome.h @@ -32,6 +32,7 @@ typedef struct { GtkWidget *container; GtkToolItem *back_button; GtkToolItem *forward_button; + GtkToolItem *stop_reload_button; GtkWidget *uri_entry; WebKitWebView *web_view; } MqTabChrome; |