summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/web-view.c26
-rw-r--r--src/web-view.h9
2 files changed, 33 insertions, 2 deletions
diff --git a/src/web-view.c b/src/web-view.c
index 941e6f2..21bb6c3 100644
--- a/src/web-view.c
+++ b/src/web-view.c
@@ -588,8 +588,7 @@ constructed(GObject *object)
}
}
- webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(web_view),
- mq_config_get_double(web_view->config, "zoom.default"));
+ mq_web_view_zoom_reset(web_view);
gtk_widget_set_vexpand(GTK_WIDGET(web_view), TRUE);
/* FIXME: This doesn't seem to be working. */
@@ -738,3 +737,26 @@ mq_web_view_load_uri(MqWebView *web_view, const gchar *uri)
g_object_notify_by_pspec(G_OBJECT(web_view),
obj_properties[PROP_REWRITTEN_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);
+}
+
+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);
+}
+
+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"));
+}
diff --git a/src/web-view.h b/src/web-view.h
index 24a1ba5..a662641 100644
--- a/src/web-view.h
+++ b/src/web-view.h
@@ -56,6 +56,15 @@ mq_web_view_get_uri(MqWebView *web_view);
void
mq_web_view_load_uri(MqWebView *web_view, const gchar *uri);
+void
+mq_web_view_zoom_in(MqWebView *web_view);
+
+void
+mq_web_view_zoom_out(MqWebView *web_view);
+
+void
+mq_web_view_zoom_reset(MqWebView *web_view);
+
G_END_DECLS
#endif /* MQ_WEB_VIEW_H */