aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-01-19 01:22:54 +0100
committerGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-01-19 01:22:54 +0100
commit67c68ee643eaef16277fa614d873dd558bfdbd04 (patch)
tree3db3ed344a50a770e9e770708a7b2b62346bf71b
parent5bff51f975487e9ae4183892d8aed13255a76e94 (diff)
parentc8fb24d1069aa776bccdf3141adb9d3c3f6e8101 (diff)
Merge remote branch 'Dieterbe/experimental' into experimental
-rw-r--r--README1
-rw-r--r--src/callbacks.c13
-rw-r--r--src/callbacks.h3
-rw-r--r--src/uzbl-core.c3
-rw-r--r--src/uzbl-core.h1
5 files changed, 20 insertions, 1 deletions
diff --git a/README b/README
index 99daef1..a0a5afa 100644
--- a/README
+++ b/README
@@ -236,6 +236,7 @@ Besides the builtin variables you can also define your own ones and use them in
- `fantasy_font_family` = "Pterra"
- `serif_font_family` = serif (example "DejaVu Serif")
- `sans_serif_font_family` = sans (example "DejaVu Sans")
+ - `scrollbars_visible`: set to 1 to have GTK scrollbars if the document doesn't fit into the window (defaults to 0)
* Constants (not dumpable or writeable):
diff --git a/src/callbacks.c b/src/callbacks.c
index b2f05cf..80846e3 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -281,6 +281,19 @@ cmd_useragent() {
}
}
+void
+cmd_scrollbars_visibility() {
+ if(uzbl.gui.scrollbars_visible) {
+ uzbl.gui.bar_h = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (uzbl.gui.scrolled_win));
+ uzbl.gui.bar_v = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (uzbl.gui.scrolled_win));
+ }
+ else {
+ uzbl.gui.bar_v = gtk_range_get_adjustment (GTK_RANGE (uzbl.gui.scbar_v));
+ uzbl.gui.bar_h = gtk_range_get_adjustment (GTK_RANGE (uzbl.gui.scbar_h));
+ }
+ gtk_widget_set_scroll_adjustments (GTK_WIDGET (uzbl.gui.web_view), uzbl.gui.bar_h, uzbl.gui.bar_v);
+}
+
/* requires webkit >=1.1.14 */
void
cmd_view_source() {
diff --git a/src/callbacks.h b/src/callbacks.h
index 7fe5c19..242c510 100644
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -116,6 +116,9 @@ void
cmd_view_source();
void
+cmd_scrollbars_visibility();
+
+void
cmd_load_start();
WebKitWebSettings*
diff --git a/src/uzbl-core.c b/src/uzbl-core.c
index 3e164c6..f5b89df 100644
--- a/src/uzbl-core.c
+++ b/src/uzbl-core.c
@@ -139,6 +139,7 @@ const struct var_name_to_ptr_t {
{ "default_encoding", PTR_V_STR(uzbl.behave.default_encoding, 1, cmd_default_encoding)},
{ "enforce_96_dpi", PTR_V_INT(uzbl.behave.enforce_96dpi, 1, cmd_enforce_96dpi)},
{ "caret_browsing", PTR_V_INT(uzbl.behave.caret_browsing, 1, cmd_caret_browsing)},
+ { "scrollbars_visible", PTR_V_INT(uzbl.gui.scrollbars_visible, 1, cmd_scrollbars_visibility)},
/* constants (not dumpable or writeable) */
{ "WEBKIT_MAJOR", PTR_C_INT(uzbl.info.webkit_major, NULL)},
@@ -1078,7 +1079,7 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result) {
JSStringRelease(js_result_string);
}
- else if (js_exc && JSValueIsObject(context, js_exc)) {
+ else if (js_exc) {
size_t size;
JSStringRef prop, val;
JSObjectRef exc = JSValueToObject(context, js_exc, NULL);
diff --git a/src/uzbl-core.h b/src/uzbl-core.h
index 875feae..e05fcdb 100644
--- a/src/uzbl-core.h
+++ b/src/uzbl-core.h
@@ -55,6 +55,7 @@ typedef struct {
GtkScrollbar* scbar_h; // (These are still hidden)
GtkAdjustment* bar_v; // Information about document length
GtkAdjustment* bar_h; // and scrolling position
+ int scrollbars_visible;
WebKitWebView* web_view;
gchar* main_title;
gchar* icon;