[squeak-dev] The Trunk: Morphic-topa.1091.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 1 23:25:43 UTC 2016
Tobias Pape uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-topa.1091.mcz
==================== Summary ====================
Name: Morphic-topa.1091
Author: topa
Time: 2 March 2016, 12:24:01.676712 am
UUID: eb8276fa-d3ef-42e6-925f-9dd92ba97121
Ancestors: Morphic-topa.1090
Wee tiny cosmetic change to trees:
Start tree-lines at indent-level 1, so tress with no children beyond the roots
whatsoever look very similar to lists.
=============== Diff against Morphic-topa.1090 ===============
Item was removed:
- ----- Method: IndentingListItemMorph>>drawLinesOn:lineColor: (in category 'drawing') -----
- drawLinesOn: aCanvas lineColor: lineColor
- | hasToggle |
- hasToggle := self hasToggle.
- "Draw line from toggle to text"
- self drawLineToggleToTextOn: aCanvas lineColor: lineColor hasToggle: hasToggle.
-
- "Draw the line from my toggle to the nextSibling's toggle"
- self nextVisibleSibling ifNotNil: [ self drawLinesToNextSiblingOn: aCanvas lineColor: lineColor hasToggle: hasToggle ].
-
- "If I have children and am expanded, draw a line to my first child"
- (self firstVisibleChild notNil and: [ self isExpanded ])
- ifTrue: [ self drawLinesToFirstChildOn: aCanvas lineColor: lineColor]!
Item was added:
+ ----- Method: IndentingListItemMorph>>drawLinesOn:lineColor:indentThreshold: (in category 'drawing') -----
+ drawLinesOn: aCanvas lineColor: lineColor indentThreshold: aNumber
+ self indentLevel > aNumber ifTrue: [
+ | hasToggle |
+ hasToggle := self hasToggle.
+ "Draw line from toggle to text"
+ self drawLineToggleToTextOn: aCanvas lineColor: lineColor hasToggle: hasToggle.
+
+ "Draw the line from my toggle to the nextSibling's toggle"
+ self nextVisibleSibling ifNotNil: [ self drawLinesToNextSiblingOn: aCanvas lineColor: lineColor hasToggle: hasToggle ]].
+
+ "If I have children and am expanded, draw a line to my first child"
+ ((self firstVisibleChild notNil
+ and: [self isExpanded])
+ and: [self firstVisibleChild indentLevel > aNumber])
+ ifTrue: [ self drawLinesToFirstChildOn: aCanvas lineColor: lineColor ]!
Item was changed:
----- Method: IndentingListItemMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
| tRect sRect columnScanner columnLeft |
self backgroundColor ifNotNil: [:c |
aCanvas fillRectangle: self innerBounds color: c].
tRect := self toggleRectangle.
self drawToggleOn: aCanvas in: tRect.
+ sRect := bounds withLeft: tRect right + self hMargin.
- sRect := bounds withLeft: tRect right + 4.
sRect := sRect top: sRect top + sRect bottom - self fontToUse height // 2.
(container columns isNil or: [(contents asString indexOf: Character tab) = 0]) ifTrue: [
icon ifNotNil: [
aCanvas
translucentImage: icon
at: sRect left @ (self top + (self height - icon height // 2)).
sRect := sRect left: sRect left + icon width + 2.
].
aCanvas drawString: contents asString in: sRect font: self fontToUse color: color.
] ifFalse: [
columnLeft := sRect left.
columnScanner := ReadStream on: contents asString.
container columns withIndexDo: [ :widthSpec :column | | columnRect columnData columnWidth |
"Draw icon."
column = self class iconColumnIndex ifTrue: [
icon ifNotNil: [
aCanvas
translucentImage: icon
at: columnLeft @ (self top + (self height - icon height // 2)).
columnLeft := columnLeft + icon width + 2]].
columnWidth := self widthOfColumn: column.
columnRect := columnLeft @ sRect top extent: columnWidth @ sRect height.
columnData := columnScanner upTo: Character tab.
"Draw string."
columnData ifNotEmpty: [
aCanvas drawString: columnData in: columnRect font: self fontToUse color: color].
"Compute next column offset."
columnLeft := columnRect right + 5.
column = 1 ifTrue: [columnLeft := columnLeft - tRect right + self left].
].
]!
Item was changed:
----- Method: IndentingListItemMorph>>hMargin (in category 'accessing') -----
hMargin
^ 3!
Item was changed:
----- Method: SimpleHierarchicalListMorph>>drawLinesOn: (in category 'drawing') -----
drawLinesOn: aCanvas
| lColor |
lColor := self lineColor.
aCanvas
transformBy: scroller transform
clippingTo: scroller innerBounds
during:[:clippedCanvas |
scroller submorphs
select: [:submorph | submorph visible]
thenDo: [ :submorph |
((submorph isExpanded
or: [clippedCanvas isVisible: submorph fullBounds] )
or: [ submorph nextSibling notNil and: [clippedCanvas isVisible: submorph nextSibling]])
+ ifTrue: [submorph drawLinesOn: clippedCanvas lineColor: lColor indentThreshold: 0] ] ]
- ifTrue: [submorph drawLinesOn: clippedCanvas lineColor: lColor] ] ]
smoothing: scroller smoothing.
!
More information about the Squeak-dev
mailing list
|