]> Skullheadx's Git Forge - surf.git/commitdiff
Making zoom available when used in tabbed.
authorChristoph Lohmann <20h@r-36.net>
Sun, 2 Dec 2012 21:41:18 +0000 (22:41 +0100)
committerChristoph Lohmann <20h@r-36.net>
Sun, 2 Dec 2012 21:41:18 +0000 (22:41 +0100)
config.def.h
surf.1
surf.c

index 362e1d2429abeb0df50d1aec12a321d62bc44298..57bf31efe678aa692a8af7157e10de57f837ec26 100644 (file)
@@ -51,6 +51,8 @@ static Key keys[] = {
     { MODKEY|GDK_SHIFT_MASK,GDK_j,      zoom,       { .i = -1 } },
     { MODKEY|GDK_SHIFT_MASK,GDK_k,      zoom,       { .i = +1 } },
     { MODKEY|GDK_SHIFT_MASK,GDK_i,      zoom,       { .i = 0  } },
+    { MODKEY,               GDK_minus,  zoom,       { .i = -1 } },
+    { MODKEY,               GDK_plus,   zoom,       { .i = +1 } },
     { MODKEY,               GDK_l,      navigate,   { .i = +1 } },
     { MODKEY,               GDK_h,      navigate,   { .i = -1 } },
     { MODKEY,               GDK_j,           scroll_v,   { .i = +1 } },
diff --git a/surf.1 b/surf.1
index e45ee37e623d067ea932a3198b5ebce4d2226587..bf78ceb3efae26d97cd2523e29765e8d1c544fc4 100644 (file)
--- a/surf.1
+++ b/surf.1
@@ -79,10 +79,10 @@ Scroll horizontally to the right.
 .B Ctrl\-u
 Scroll horizontally to the left.
 .TP
-.B Ctrl\-Shift\-k
+.B Ctrl\-Shift\-k or Ctrl\-+
 Zooms page in.
 .TP
-.B Ctrl\-Shift\-j
+.B Ctrl\-Shift\-j or Ctrl\--
 Zooms page out
 .TP
 .B Ctrl\-Shift\-i
diff --git a/surf.c b/surf.c
index 78698b83d56bb17a58bdb77452d333064d24934b..a15ed00fc8bef0f0419bd8f0a32a78dd10cc44c7 100644 (file)
--- a/surf.c
+++ b/surf.c
@@ -986,11 +986,14 @@ windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js, JSObje
 void
 zoom(Client *c, const Arg *arg) {
        c->zoomed = TRUE;
-       if(arg->i < 0)          /* zoom out */
+       if(arg->i < 0) {
+               /* zoom out */
                webkit_web_view_zoom_out(c->view);
-       else if(arg->i > 0)     /* zoom in */
+       } else if(arg->i > 0) {
+               /* zoom in */
                webkit_web_view_zoom_in(c->view);
-       else {                  /* reset */
+       } else {
+               /* reset */
                c->zoomed = FALSE;
                webkit_web_view_set_zoom_level(c->view, 1.0);
        }