--- a/Scroller.st Tue Sep 22 17:05:43 2015 +0200
+++ b/Scroller.st Tue Sep 22 17:06:06 2015 +0200
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libwidg' }"
+"{ NameSpace: Smalltalk }"
+
View subclass:#Scroller
instanceVariableNames:'thumbOrigin thumbHeight thumbColor thumbFrameColor scrollAction
orientation thumbFrame thumbLevel scrolling pressOffset
@@ -1227,24 +1229,33 @@
|handleX handleY l t lvl
w "{ Class: SmallInteger }"
h "{ Class: SmallInteger }"
- clr clr2 xpStyle vistaStyle n frameImageOrNil frameImage|
+ clr clr2 styleName xpStyle vistaStyle n frameImageOrNil frameImage|
(thumbHeight >= 100) ifTrue:[^ self].
thumbFrame isNil ifTrue:[^ self].
- xpStyle := styleSheet name == #winXP.
- vistaStyle := styleSheet name == #winVista.
+ styleName := styleSheet name.
+ xpStyle := styleName == #winXP.
+ vistaStyle := styleName == #winVista.
w := thumbFrame width.
h := thumbFrame height.
l := thumbFrame left.
t := thumbFrame top.
- clr := entered ifTrue:[thumbEnteredColor] ifFalse:[thumbColor].
- (scrolling and:[thumbActiveColor notNil]) ifTrue:[clr := thumbActiveColor].
+ (scrolling and:[thumbActiveColor notNil]) ifTrue:[
+ clr := thumbActiveColor
+ ] ifFalse:[
+ clr := entered
+ ifTrue:[thumbEnteredColor]
+ ifFalse:[thumbColor].
+ ].
+
clr notNil ifTrue:[
(styleSheet at:#'scroller.vista3DStyle' default:false) ifTrue:[
- "/ 243 242 240 236 234 233 215 211 207 205 200 192 206
+ "/ 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
(orientation == #vertical) ifTrue:[
n := w
] ifFalse:[
@@ -1292,13 +1303,43 @@
] ifFalse:[
self paint:clr.
(xpStyle and:[self isMiniScroller not]) ifTrue:[
+ "/ hack for xp
(orientation == #vertical) ifTrue:[
self fillRectangleX:l y:t+1 width:w-2 height:h-4.
] ifFalse:[
self fillRectangleX:l+1 y:t width:w-4 height:h-2.
]
] ifFalse:[
- self fillRectangleX:l y:t width:w height:h.
+ (styleSheet at:#'scroller.roundStyle' default:false) ifTrue:[
+ "/ hack for osx
+ (orientation == #vertical) ifTrue:[
+ 1 to:3 do:[:i |
+ |yLine left right|
+
+ left := l+i-1.
+ right := l+w-i+1.
+ yLine := t+3-i.
+ self displayLineFromX:left y:yLine toX:right y:yLine.
+ yLine := t+h-3-1+i.
+ self displayLineFromX:left y:yLine toX:right y:yLine.
+ ].
+ self 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 := l+3-i.
+ self displayLineFromX:xLine y:top toX:xLine y:bot.
+ xLine := l+w-3-1+i.
+ self displayLineFromX:xLine y:top toX:xLine y:bot.
+ ].
+ self fillRectangleX:l+3 y:t width:w-6 height:h.
+ ].
+ ] ifFalse:[
+ self fillRectangleX:l y:t width:w height:h.
+ ].
].
].
].
@@ -2772,10 +2813,10 @@
!Scroller class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.208 2014-12-08 22:13:13 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.208 2014-12-08 22:13:13 cg Exp $'
+ ^ '$Header$'
! !