]> git.armaanb.net Git - chorizo.git/commitdiff
Improve mouse wheel zoom and update README
authorPeter Hofmann <scm@uninformativ.de>
Sun, 9 Nov 2014 13:05:59 +0000 (14:05 +0100)
committerPeter Hofmann <scm@uninformativ.de>
Sun, 9 Nov 2014 13:06:52 +0000 (14:06 +0100)
README
browser.c

diff --git a/README b/README
index ae4e66b6523f281629c05e6eb710038a51de6c92..9f69486e81c941243a2a1c1e52837d19e0e098d4 100644 (file)
--- a/README
+++ b/README
@@ -165,12 +165,15 @@ Main windows
         Backward / forward (mouse keys 8 and 9)
             Does the obvious.
 
-        Mod1 + Wheel up  or  Ctrl + Wheel up
+        Mod1 + Scroll up  or  Ctrl + Scroll up
             Increase zoom level of the current page.
 
-        Mod1 + Wheel down  or  Ctrl + Wheel down
+        Mod1 + Scroll down  or  Ctrl + Scroll down
             Decrase zoom level of the current page.
 
+        Mod1 + Scroll horizontally  or  Ctrl + Scroll horizontally
+            Reset zoom to $LARIZA_ZOOM.
+
 
     When the location bar is focused:
 
index 8cf663f9d11c0f23b1d32241a73b1cf422545535..cf8d2a05b839154b71a67663fdb2d1535da29028 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -714,10 +714,8 @@ key_web_view(GtkWidget *widget, GdkEvent *event, gpointer data)
                {
                        gdk_event_get_scroll_deltas(event, &dx, &dy);
                        z = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(c->web_view));
-                       if (dy == 1)
-                               z += 0.1;
-                       else if (dy == -1)
-                               z -= 0.1;
+                       z += -dy * 0.1;
+                       z = dx != 0 ? global_zoom : z;
                        webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(c->web_view), z);
                        return TRUE;
                }