summaryrefslogtreecommitdiff
path: root/lisp/scroll-bar.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>1999-11-19 20:18:47 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>1999-11-19 20:18:47 +0000
commitd294c01f599fb45accd879fabc0d23a6daa4acef (patch)
tree2d5eb52ac105ab1e73c5943d9595da5576a25a21 /lisp/scroll-bar.el
parenta9fb0b79abd70f29a2d5244d64d2b3ae1a465b0d (diff)
downloademacs-d294c01f599fb45accd879fabc0d23a6daa4acef.tar.gz
(scroll-bar-toolkit-scroll): add handling of the `ratio'
event for Xaw and Xaw3d(without arrows) scrollbars.
Diffstat (limited to 'lisp/scroll-bar.el')
-rw-r--r--lisp/scroll-bar.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index 4499c0b0b5f..aea8c8e72f5 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -316,6 +316,13 @@ EVENT should be a scroll bar click."
(scroll-up '-))
((eq part 'below-handle)
(scroll-up nil))
+ ((eq part 'ratio)
+ (let* ((portion-whole (nth 2 end-position))
+ (lines (scroll-bar-scale portion-whole
+ (1- (window-height)))))
+ (scroll-up (cond ((not (zerop lines)) lines)
+ ((< (car portion-whole) 0) -1)
+ (t 1)))))
((eq part 'up)
(scroll-up -1))
((eq part 'down)
@@ -330,7 +337,7 @@ EVENT should be a scroll bar click."
(sit-for 0)
(unless scroll-bar-timer
(setq scroll-bar-timer
- (run-with-timer 0.1 0.1 'xt-process-timeouts)))
+ (run-with-timer 0.1 0.1 'xt-process-timeouts)))
(with-current-buffer (window-buffer window)
(setq point-before-scroll before-scroll))))))