#BUGFIX by cg
class: Scroller
comment/format in: #computeThumbFrame
changed:
#drawThumb
#sizeChanged:
--- a/Scroller.st Sat Nov 10 00:40:17 2018 +0100
+++ b/Scroller.st Fri Nov 16 15:59:52 2018 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -1253,7 +1251,7 @@
].
clr notNil ifTrue:[
- (styleSheet at:#'scroller.vista3DStyle' default:false) ifTrue:[
+ vistaStyle ifTrue:[
"/ color gradient drawing
"/ with colors rougly smilar to the vista colors, which are:
"/ 243 242 240 236 234 233 215 211 207 205 200 192 206
@@ -1317,26 +1315,26 @@
"/ hack for osx
(orientation == #vertical) ifTrue:[
1 to:3 do:[:i |
- |yLine left right|
-
- left := l+i-1.
- right := l+w-i+1.
+ |yLine lefti righti|
+
+ lefti := l+i-1.
+ righti := l+w-i+1.
yLine := t+3-i.
- gc displayLineFromX:left y:yLine toX:right y:yLine.
+ gc displayLineFromX:lefti y:yLine toX:righti y:yLine.
yLine := t+h-3-1+i.
- gc displayLineFromX:left y:yLine toX:right y:yLine.
+ gc displayLineFromX:lefti y:yLine toX:righti y:yLine.
].
gc fillRectangleX:l y:t+3 width:w height:h-6.
] ifFalse:[
1 to:3 do:[:i |
- |xLine top bot|
-
- top := t+i-1.
- bot := t+h-i+1.
+ |xLine topi boti|
+
+ topi := t+i-1.
+ boti := t+h-i+1.
xLine := l+3-i.
- gc displayLineFromX:xLine y:top toX:xLine y:bot.
+ gc displayLineFromX:xLine y:topi toX:xLine y:boti.
xLine := l+w-3-1+i.
- gc displayLineFromX:xLine y:top toX:xLine y:bot.
+ gc displayLineFromX:xLine y:topi toX:xLine y:boti.
].
gc fillRectangleX:l+3 y:t width:w-6 height:h.
].
@@ -1427,6 +1425,7 @@
self drawTallyMarks.
"Modified: / 29-11-2011 / 11:55:24 / cg"
+ "Modified (format): / 16-11-2018 / 15:29:29 / Claus Gittinger"
!
drawThumbBackgroundInX:x y:y width:w height:h
@@ -1963,6 +1962,13 @@
thumbFrame = oldThumbFrame ifTrue:[
^ self
].
+
+ (styleSheet at:#'scroller.roundStyle' default:false) ifTrue:[
+ "/ q&d hack arround a redraw error with rounded thumb
+ self invalidate.
+ ^ self
+ ].
+
thumbFrame isNil ifTrue:[
self invalidate.
^ self
@@ -2047,9 +2053,10 @@
].
].
- self invalidate:(oldThumbFrame merge: thumbFrame).
-
- "Modified: / 23.5.1999 / 13:50:41 / cg"
+ self invalidate:(oldThumbFrame merge:thumbFrame).
+
+ "Modified: / 23-05-1999 / 13:50:41 / cg"
+ "Modified (format): / 16-11-2018 / 15:59:21 / Claus Gittinger"
!
update:something with:aParameter from:changedObject
@@ -2424,8 +2431,8 @@
!
computeThumbFrame
- "compute the thumbs frame (a rectangle) whenever thumb is moved,
- changed height or the scrollers size has changed.
+ "compute the thumb's frame (a rectangle) whenever thumb is moved,
+ changed height or the scroller's size has changed.
We take care, that the thumb will not become too small (i.e.
invisible or uncatchable).
Also, for mswindows style, its height/width is constant."
@@ -2558,6 +2565,7 @@
"Modified: / 12-05-1998 / 20:58:51 / cg"
"Modified (comment): / 13-02-2017 / 20:30:04 / cg"
+ "Modified (comment): / 16-11-2018 / 15:23:36 / Claus Gittinger"
!
percentFromAbs:absValue