summaryrefslogtreecommitdiff
path: root/desktop/textarea.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-02-08 15:26:24 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-02-08 15:26:24 +0000
commit698f391289d8c53c19b170dd3b726314ba394826 (patch)
tree7dbfda126af35a680794b2f8045ca08018fa81e1 /desktop/textarea.c
parentf57e89cc25e92c2ad4eb419e745955595248088b (diff)
downloadnetsurf-698f391289d8c53c19b170dd3b726314ba394826.tar.gz
netsurf-698f391289d8c53c19b170dd3b726314ba394826.tar.bz2
Add scrollwheel support to textareas.
Diffstat (limited to 'desktop/textarea.c')
-rw-r--r--desktop/textarea.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 59257d208..25630e464 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -2078,3 +2078,19 @@ void textarea_set_layout(struct textarea *ta, int width, int height,
ta->pad_left = left;
textarea_reflow(ta, 0);
}
+
+
+/* exported interface, documented in textarea.h */
+bool textarea_scroll(struct textarea *ta, int scrx, int scry)
+{
+ bool handled_scroll = false;
+
+ if (ta->bar_x != NULL && scrx != 0 &&
+ scrollbar_scroll(ta->bar_x, scrx))
+ handled_scroll = true;
+ if (ta->bar_y != NULL && scry != 0 &&
+ scrollbar_scroll(ta->bar_y, scry))
+ handled_scroll = true;
+
+ return handled_scroll;
+}