Making zoom available when used in tabbed.

This commit is contained in:
Christoph Lohmann 2012-12-02 22:41:18 +01:00
parent 6cd54e4a31
commit e96f191088
3 changed files with 10 additions and 5 deletions

View file

@ -51,6 +51,8 @@ static Key keys[] = {
{ MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 } }, { MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 } },
{ MODKEY|GDK_SHIFT_MASK,GDK_k, zoom, { .i = +1 } }, { MODKEY|GDK_SHIFT_MASK,GDK_k, zoom, { .i = +1 } },
{ MODKEY|GDK_SHIFT_MASK,GDK_i, zoom, { .i = 0 } }, { 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_l, navigate, { .i = +1 } },
{ MODKEY, GDK_h, navigate, { .i = -1 } }, { MODKEY, GDK_h, navigate, { .i = -1 } },
{ MODKEY, GDK_j, scroll_v, { .i = +1 } }, { MODKEY, GDK_j, scroll_v, { .i = +1 } },

4
surf.1
View file

@ -79,10 +79,10 @@ Scroll horizontally to the right.
.B Ctrl\-u .B Ctrl\-u
Scroll horizontally to the left. Scroll horizontally to the left.
.TP .TP
.B Ctrl\-Shift\-k .B Ctrl\-Shift\-k or Ctrl\-+
Zooms page in. Zooms page in.
.TP .TP
.B Ctrl\-Shift\-j .B Ctrl\-Shift\-j or Ctrl\--
Zooms page out Zooms page out
.TP .TP
.B Ctrl\-Shift\-i .B Ctrl\-Shift\-i

9
surf.c
View file

@ -986,11 +986,14 @@ windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js, JSObje
void void
zoom(Client *c, const Arg *arg) { zoom(Client *c, const Arg *arg) {
c->zoomed = TRUE; c->zoomed = TRUE;
if(arg->i < 0) /* zoom out */ if(arg->i < 0) {
/* zoom out */
webkit_web_view_zoom_out(c->view); 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); webkit_web_view_zoom_in(c->view);
else { /* reset */ } else {
/* reset */
c->zoomed = FALSE; c->zoomed = FALSE;
webkit_web_view_set_zoom_level(c->view, 1.0); webkit_web_view_set_zoom_level(c->view, 1.0);
} }