diff options
author | 2009-06-22 16:51:11 -0300 | |
---|---|---|
committer | 2009-06-22 16:51:11 -0300 | |
commit | 432aaedb4078bea825451e4df1f681e58456f065 (patch) | |
tree | 9cfbcb6eee4c0c32d945c8af54fb4dbf3555f72c | |
parent | befe76fad5ebea3f0acbd7da74761863f65637c1 (diff) | |
parent | 12af838675fa5eae32a8b97cf8fe81c2c812639f (diff) |
Merge commit 'dieterbe/experimental' into experimental
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | uzbl.c | 20 |
3 files changed, 26 insertions, 13 deletions
@@ -28,6 +28,7 @@ Contributors: (israellevin) - toggle_zoom_type (kmeaw) - fix for multibyte utf8 characters segfault (evocallaghan) - tiny patches + Aaron Griffin (phrakture) - Makefile patches to build on OSX Originaly based on http://trac.webkit.org/browser/trunk/WebKitTools/GtkLauncher/main.c Which is copyrighted: @@ -1,5 +1,5 @@ -CFLAGS:=-std=c99 $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -lgthread-2.0 -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS) -LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4) -pthread $(LDFLAGS) +CFLAGS:=-std=c99 $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -lgthread-2.0 -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS) +LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -pthread $(LDFLAGS) all: uzbl uzblctrl PREFIX?=$(DESTDIR)/usr @@ -22,13 +22,13 @@ install: install -d $(PREFIX)/bin install -d $(PREFIX)/share/uzbl/docs install -d $(PREFIX)/share/uzbl/examples - install -D -m755 uzbl $(PREFIX)/bin/uzbl - install -D -m755 uzblctrl $(PREFIX)/bin/uzblctrl - cp -ax docs $(PREFIX)/share/uzbl/ - cp -ax config.h $(PREFIX)/share/uzbl/docs/ - cp -ax examples $(PREFIX)/share/uzbl/ - install -D -m644 AUTHORS $(PREFIX)/share/uzbl/docs - install -D -m644 README $(PREFIX)/share/uzbl/docs + install -m755 uzbl $(PREFIX)/bin/uzbl + install -m755 uzblctrl $(PREFIX)/bin/uzblctrl + cp -rp docs $(PREFIX)/share/uzbl/ + cp -rp config.h $(PREFIX)/share/uzbl/docs/ + cp -rp examples $(PREFIX)/share/uzbl/ + install -m644 AUTHORS $(PREFIX)/share/uzbl/docs + install -m644 README $(PREFIX)/share/uzbl/docs uninstall: @@ -445,12 +445,24 @@ download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data) { /* scroll a bar in a given direction */ static void scroll (GtkAdjustment* bar, GArray *argv) { - gdouble amount; gchar *end; + gdouble max_value; - amount = g_ascii_strtod(g_array_index(argv, gchar*, 0), &end); - if (*end == '%') amount = gtk_adjustment_get_page_size(bar) * amount * 0.01; - gtk_adjustment_set_value (bar, gtk_adjustment_get_value(bar)+amount); + gdouble page_size = gtk_adjustment_get_page_size(bar); + gdouble value = gtk_adjustment_get_value(bar); + gdouble amount = g_ascii_strtod(g_array_index(argv, gchar*, 0), &end); + + if (*end == '%') + value += page_size * amount * 0.01; + else + value += amount; + + max_value = gtk_adjustment_get_upper(bar) - page_size; + + if (value > max_value) + value = max_value; /* don't scroll past the end of the page */ + + gtk_adjustment_set_value (bar, value); } static void |