summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-12 18:15:05 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-12 18:15:05 (EDT)
commit3fe6ac0257cdf2e75437677b25c87bb57722a836 (patch)
tree1206777855a6e7c1132b8dfb47f6ad41a520d22c
parentca5c031f56967aa8a3d2885c5ed0abfc4ab61644 (diff)
downloadmarquee-3fe6ac0257cdf2e75437677b25c87bb57722a836.zip
marquee-3fe6ac0257cdf2e75437677b25c87bb57722a836.tar.gz
marquee-3fe6ac0257cdf2e75437677b25c87bb57722a836.tar.bz2
mq_web_view_zoom_*(): Make more readable
-rw-r--r--src/web-view.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/web-view.c b/src/web-view.c
index 21bb6c3..ebebcba 100644
--- a/src/web-view.c
+++ b/src/web-view.c
@@ -741,22 +741,28 @@ mq_web_view_load_uri(MqWebView *web_view, const gchar *uri)
void
mq_web_view_zoom_in(MqWebView *web_view)
{
- webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view),
- webkit_web_view_get_zoom_level(
- WEBKIT_WEB_VIEW(web_view)) + 0.1);
+ gdouble zoom_level;
+
+ zoom_level = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(web_view));
+ zoom_level += 0.1;
+ webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view), zoom_level);
}
void
mq_web_view_zoom_out(MqWebView *web_view)
{
- webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view),
- webkit_web_view_get_zoom_level(
- WEBKIT_WEB_VIEW(web_view)) - 0.1);
+ gdouble zoom_level;
+
+ zoom_level = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(web_view));
+ zoom_level -= 0.1;
+ webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view), zoom_level);
}
void
mq_web_view_zoom_reset(MqWebView *web_view)
{
- webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view),
- mq_config_get_double(web_view->config, "zoom.default"));
+ gdouble zoom_level;
+
+ zoom_level = mq_config_get_double(web_view->config, "zoom.default");
+ webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view), zoom_level);
}