From 7c9a52431393a605d3a6838117e2576521aaf909 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 28 Sep 2017 16:46:48 -0400 Subject: MqTabChrome: Make zoom buttons functional --- 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. */ -- cgit v0.9.1