--- a/HierarchicalListView.st Thu Oct 10 07:58:47 2002 +0200
+++ b/HierarchicalListView.st Thu Oct 10 09:00:20 2002 +0200
@@ -653,7 +653,7 @@
drawElementsFrom:start to:stop x:xLeft y:yT w:w
"draw the items between start to stop without clearing the background
"
- |item prevItem parent icon showIndc showIcon showText nxtPrnt
+ |item prevItem parent icon showIndc showIcon showText nxtPrnt iconHeight
iconExtent
yTop "{ Class:SmallInteger }"
yCtr "{ Class:SmallInteger }"
@@ -742,24 +742,44 @@
].
(showIcon and:[(icon := self figureFor:item) notNil]) ifTrue:[
- iconWidth := icon width.
- iconRgtX := xIcon + iconWidth.
- xDeltaIT := xText - textStartLeft - iconRgtX.
+ iconWidth := icon width.
+ iconHeight := icon height.
+ iconRgtX := xIcon + iconWidth.
+ xDeltaIT := xText - textStartLeft - iconRgtX.
xDeltaIT < 0 ifTrue:[
alignTextRightX := alignTextRightX - xDeltaIT.
alignTextRight ifFalse:[
- imageWidth := iconWidth.
+ imageWidth := iconWidth.
widthOfContents := widthOfContents - xDeltaIT.
] ifTrue:[
widthOfContents := alignTextRightX + maxWidthOfText
].
+
+ widthLvl := self xOfStringLevel:(item level).
+ xText := item widthOn:self.
+ xText > maxWidthOfText ifTrue:[ maxWidthOfText := xText ].
+
+ widthOfContents := (widthLvl + xText) max:widthOfContents.
+
+ (constantHeight notNil and:[ iconHeight >= constantHeight ]) ifTrue:[
+ constantHeight := iconHeight + lineSpacing.
+ self recomputeHeightOfContents.
+ ].
self contentsChanged.
StopRedrawSignal raise
].
+
iconRgtX > xL ifTrue:[
- icon displayOn:self x:xIcon y:(yCtr - (icon height // 2))
+ (constantHeight notNil and:[ iconHeight >= constantHeight ]) ifTrue:[
+ constantHeight := iconHeight + lineSpacing.
+
+ self recomputeHeightOfContents.
+ self contentsChanged.
+ StopRedrawSignal raise
+ ].
+ icon displayOn:self x:xIcon y:(yCtr - (iconHeight // 2))
]
].
@@ -1416,5 +1436,5 @@
!HierarchicalListView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.52 2002-10-09 14:30:06 ca Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.53 2002-10-10 07:00:20 ca Exp $'
! !