summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-09-28 16:46:48 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-09-28 16:46:48 (EDT)
commit7c9a52431393a605d3a6838117e2576521aaf909 (patch)
tree5972ed33f1379e1c8d7d91c614dbdbe32f0932a0
parent4d5813c5bc36db88e26afdac6fcaed794c8f8662 (diff)
downloadmarquee-7c9a52431393a605d3a6838117e2576521aaf909.zip
marquee-7c9a52431393a605d3a6838117e2576521aaf909.tar.gz
marquee-7c9a52431393a605d3a6838117e2576521aaf909.tar.bz2
MqTabChrome: Make zoom buttons functional
-rw-r--r--src/tab-chrome.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tab-chrome.c b/src/tab-chrome.c
index 97dd210..dac1340 100644
--- a/src/tab-chrome.c
+++ b/src/tab-chrome.c
@@ -302,6 +302,29 @@ uri_activate_cb(GtkEntry *entry, MqTabChrome *chrome)
}
static void
+zoom_out_clicked_cb(GtkButton __attribute__((unused)) *button,
+ MqTabChrome *chrome)
+{
+ webkit_web_view_set_zoom_level(chrome->web_view,
+ webkit_web_view_get_zoom_level(chrome->web_view) - 0.1);
+}
+
+static void
+zoom_reset_clicked_cb(GtkButton __attribute__((unused)) *button,
+ MqTabChrome *chrome)
+{
+ webkit_web_view_set_zoom_level(chrome->web_view, 1.0);
+}
+
+static void
+zoom_in_clicked_cb(GtkButton __attribute__((unused)) *button,
+ MqTabChrome *chrome)
+{
+ webkit_web_view_set_zoom_level(chrome->web_view,
+ webkit_web_view_get_zoom_level(chrome->web_view) + 0.1);
+}
+
+static void
quit_clicked_cb(GtkButton __attribute__((unused)) *button,
MqTabChrome __attribute__((unused)) *chrome)
{
@@ -354,6 +377,9 @@ menu_button_clicked_cb(GtkToolButton *tool_button,
NEW_BUTTON(5, 0, "help-about", "About Marquee");
NEW_BUTTON(5, 2, "application-exit", "Quit");
+ CLICKED_CB(0, 0, zoom_out_clicked_cb);
+ CLICKED_CB(0, 1, zoom_reset_clicked_cb);
+ CLICKED_CB(0, 2, zoom_in_clicked_cb);
CLICKED_CB(5, 2, quit_clicked_cb);
/* Set up the popover. */