diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-01 20:08:41 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-01 20:08:41 +0200 |
commit | 565e598c0e692283faeece6db596f9e12c55df56 (patch) | |
tree | ac341698fcf7e26e0cc16f05ddc4daee1e637003 /uzbl.c | |
parent | 69c69e9ee76e8fdc973de03debb6d9a4aa053b7a (diff) | |
parent | ce28fc1243418617ab07544b6dc774693130da92 (diff) |
Merge commit 'any/master' into experimental
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 38 |
1 files changed, 13 insertions, 25 deletions
@@ -86,8 +86,6 @@ static gboolean insert_mode = FALSE; static gboolean status_top = FALSE; static gchar* modkey = NULL; static guint modmask = 0; -static gdouble hscroll = 20; -static gdouble vscroll = 20; /* settings from config: group bindings, key -> action */ static GHashTable* bindings; @@ -153,36 +151,28 @@ download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data) { /* scroll a bar in a given direction */ static void -scroll (double i, GtkAdjustment* bar) { - gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+i); -} +scroll (GtkAdjustment* bar, const char *param) { + gdouble amount; + gchar *end; -static void scroll_up (WebKitWebView* page, const char *param) { - (void) page; - (void) param; + amount = g_ascii_strtod(param, &end); - scroll (-vscroll, bar_v); -} - -static void scroll_left (WebKitWebView* page, const char *param) { - (void) page; - (void) param; + if (*end) + fprintf(stderr, "found something after double: %s\n", end); - scroll (-hscroll, bar_h); + gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+amount); } -static void scroll_down (WebKitWebView* page, const char *param) { +static void scroll_vert(WebKitWebView* page, const char *param) { (void) page; - (void) param; - scroll (vscroll, bar_v); + scroll(bar_v, param); } -static void scroll_right (WebKitWebView* page, const char *param) { +static void scroll_horz(WebKitWebView* page, const char *param) { (void) page; - (void) param; - scroll (hscroll, bar_h); + scroll(bar_h, param); } static void @@ -281,10 +271,8 @@ static struct {char *name; Command command;} cmdlist[] = { { "back", view_go_back }, { "forward", view_go_forward }, - { "scroll_down", scroll_down }, - { "scroll_up", scroll_up }, - { "scroll_left", scroll_left }, - { "scroll_right", scroll_right }, + { "scroll_vert", scroll_vert }, + { "scroll_horz", scroll_horz }, { "reload", view_reload, }, //Buggy { "refresh", view_reload, }, /* for convenience, will change */ { "stop", view_stop_loading, }, |