Added reset_zoom_level() to reset zoom to 100%, and added keybinding in sampleconfig
authoruranther <jwheaton@purdue.edu>
Fri, 29 May 2009 19:47:55 +0000 (15:47 -0400)
committeruranther <jwheaton@purdue.edu>
Fri, 29 May 2009 19:47:55 +0000 (15:47 -0400)
examples/configs/sampleconfig
uzbl.c
uzbl.h

index a541854..881173c 100644 (file)
@@ -69,6 +69,7 @@ bind    r         = reload
 bind    R         = reload_ign_cache
 bind    +         = zoom_in
 bind    -         = zoom_out
+bind    =         = reset_zoom
 bind    t         = toggle_status
 # Hilight matches. Notice the * after the slash - it makes the command incremental, i.e. gets called
 # on every character you type.  You can do `bind /_ = search %s' if you want it less interactive.
diff --git a/uzbl.c b/uzbl.c
index 1758638..acae3cf 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -544,6 +544,7 @@ static struct {char *name; Command command[2];} cmdlist[] =
     { "stop",               {view_stop_loading, 0},        },
     { "zoom_in",            {view_zoom_in, 0},             }, //Can crash (when max zoom reached?).
     { "zoom_out",           {view_zoom_out, 0},            },
+    { "reset_zoom",         {reset_zoom_level, 0},         },
     { "uri",                {load_uri, NOSPLIT}            },
     { "js",                 {run_js, NOSPLIT}              },
     { "script",             {run_external_js, 0}           },
@@ -707,6 +708,12 @@ search_reverse_text (WebKitWebView *page, GArray *argv) {
 }
 
 static void
+reset_zoom_level (WebKitWebView *page, GArray *argv) {
+    (void) argv;
+    webkit_web_view_set_zoom_level (page, 1.0);
+}
+
+static void
 dehilight (WebKitWebView *page, GArray *argv) {
     (void) argv;
     webkit_web_view_set_highlight_text_matches (page, FALSE);
diff --git a/uzbl.h b/uzbl.h
index 4c4c4ea..51a788c 100644 (file)
--- a/uzbl.h
+++ b/uzbl.h
@@ -398,6 +398,9 @@ static void
 search_reverse_text (WebKitWebView *page, GArray *argv);
 
 static void
+reset_zoom_level (WebKitWebView *page, GArray *argv);
+
+static void
 dehilight (WebKitWebView *page, GArray *argv);
 
 static void