summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-12-02 22:41:18 +0100
committerChristoph Lohmann <20h@r-36.net>2012-12-02 22:41:18 +0100
commite96f191088efd2f687aeaa1903bd9b3c8133e1af (patch)
tree7cb1d2a7c269ad1d0aead654d37bfb9fc02fd27d
parent6cd54e4a3119bd201d95f5d67ffb4bfe28aac653 (diff)
downloadsurf-e96f191088efd2f687aeaa1903bd9b3c8133e1af.tar.gz
surf-e96f191088efd2f687aeaa1903bd9b3c8133e1af.tar.bz2
surf-e96f191088efd2f687aeaa1903bd9b3c8133e1af.zip
Making zoom available when used in tabbed.
-rw-r--r--config.def.h2
-rw-r--r--surf.14
-rw-r--r--surf.c9
3 files changed, 10 insertions, 5 deletions
diff --git a/config.def.h b/config.def.h
index 362e1d2..57bf31e 100644
--- a/config.def.h
+++ b/config.def.h
@@ -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 e45ee37..bf78ceb 100644
--- 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 78698b8..a15ed00 100644
--- 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);
}