Marcel Taeumel uploaded a new version of SUnitGUI to project The Trunk:
http://source.squeak.org/trunk/SUnitGUI-mt.76.mcz
==================== Summary ====================
Name: SUnitGUI-mt.76
Author: mt
Time: 30 September 2019, 11:12:00.84171 am
UUID: e740e7cc-b7e0-374b-a7ad-1a06e32fa176
Ancestors: SUnitGUI-mt.75
Fix oversight from last commit. Sorry for the noise.
=============== Diff against SUnitGUI-mt.75 ===============
Item was changed:
----- Method: TestRunner>>categorySelected (in category 'accessing-categories') -----
categorySelected
+ ^ categoryIndex ifNil: [0]!
- ^ categoryIndex!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1548.mcz
==================== Summary ====================
Name: Morphic-mt.1548
Author: mt
Time: 30 September 2019, 10:29:19.20171 am
UUID: 0cf91407-3c2e-724d-b444-6986a9ca91a7
Ancestors: Morphic-mt.1547
Some improvements for multi-selection lists:
- hit [space] key to toggle selection
- draw the current "selection" as outline to recognize multi-selection state
- do not reset current "selection" to 0 when deselecting a row in the multi-selection state --- to better support keyboard navigation and [space]
=============== Diff against Morphic-mt.1547 ===============
Item was changed:
----- Method: LazyListMorph>>drawBackgroundForMulti:on: (in category 'drawing') -----
drawBackgroundForMulti: row on: aCanvas
"shade the background paler, if this row is selected, but not the current selected row"
| selectionDrawBounds |
- selectedRow = row ifTrue: [^ self].
selectionDrawBounds := self drawBoundsForRow: row.
selectionDrawBounds := selectionDrawBounds intersect: self bounds.
aCanvas
fillRectangle: selectionDrawBounds
color: self multiSelectionColor!
Item was changed:
----- Method: LazyListMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
| topRow bottomRow |
listItems ifEmpty: [ ^self ].
self drawPreSelectionOn: aCanvas.
topRow := self topVisibleRowForCanvas: aCanvas.
bottomRow := self bottomVisibleRowForCanvas: aCanvas.
"Draw multi-selection."
+ listSource hasMultiSelection ifTrue: [
+ topRow to: bottomRow do: [ :row |
+ (listSource itemSelectedAmongMultiple: row) ifTrue: [
+ self drawBackgroundForMulti: row on: aCanvas ] ] ].
- topRow to: bottomRow do: [ :row |
- (listSource itemSelectedAmongMultiple: row) ifTrue: [
- self drawBackgroundForMulti: row on: aCanvas ] ].
self drawSelectionOn: aCanvas.
"Draw hovered row if preference enabled."
PluggableListMorph highlightHoveredRow ifTrue: [
listSource hoverRow > 0 ifTrue: [
self highlightHoverRow: listSource hoverRow on: aCanvas ] ].
"Draw all visible rows."
topRow to: bottomRow do: [ :row |
self display: (self item: row) atRow: row on: aCanvas ].
"Finally, highlight drop row for drag/drop operations.."
listSource potentialDropRow > 0 ifTrue: [
self highlightPotentialDropRow: listSource potentialDropRow on: aCanvas ].!
Item was changed:
----- Method: LazyListMorph>>drawSelectionFor:withColor:on: (in category 'drawing') -----
drawSelectionFor: index withColor: color on: aCanvas
| selectionDrawBounds fill |
index ifNil: [ ^self ].
index = 0 ifTrue: [ ^self ].
selectionDrawBounds := self drawBoundsForRow: index.
selectionDrawBounds := selectionDrawBounds intersect: self bounds.
fill := color isColor
ifTrue: [SolidFillStyle color: color]
ifFalse: [color].
fill isGradientFill ifTrue: [
fill origin: selectionDrawBounds topLeft.
fill direction: 0@ selectionDrawBounds height].
+ listSource hasMultiSelection
+ ifFalse: [aCanvas fillRectangle: selectionDrawBounds fillStyle: fill]
+ ifTrue: [aCanvas frameRectangle: selectionDrawBounds color: fill asColor] .!
- aCanvas fillRectangle: selectionDrawBounds fillStyle: fill.!
Item was added:
+ ----- Method: PluggableListMorph>>hasMultiSelection (in category 'testing') -----
+ hasMultiSelection
+
+ ^ false!
Item was added:
+ ----- Method: PluggableListMorphOfMany>>basicKeyPressed: (in category 'model access') -----
+ basicKeyPressed: aCharacter
+
+ aCharacter = Character space
+ ifTrue: [self specialKeyPressed: aCharacter asciiValue]
+ ifFalse: [super basicKeyPressed: aCharacter].!
Item was added:
+ ----- Method: PluggableListMorphOfMany>>hasMultiSelection (in category 'testing') -----
+ hasMultiSelection
+
+ ^ true!
Item was changed:
----- Method: PluggableListMorphOfMany>>mouseDown: (in category 'event handling') -----
mouseDown: event
+ | row index |
- | oldIndex oldVal row index |
event yellowButtonPressed ifTrue: [^ self yellowButtonActivity: event shiftPressed].
row := self rowAtLocation: event position.
row = 0 ifTrue: [^super mouseDown: event].
index := self modelIndexFor: row.
model okToChange ifFalse: [^ self]. "No change if model is locked"
+ self changeModelSelection: index.
- "Set meaning for subsequent dragging of selection"
- dragOnOrOff := (self listSelectionAt: index) not.
- oldIndex := self getCurrentSelectionIndex.
- oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].
+ "Set meaning for subsequent dragging of selection"
+ self
+ listSelectionAt: index
+ put: (dragOnOrOff := (self listSelectionAt: index) not)
- "Set or clear new primary selection (listIndex)"
- dragOnOrOff
- ifTrue: [self changeModelSelection: index]
- ifFalse: [self changeModelSelection: 0].
-
- "Need to restore the old one, due to how model works, and set new one."
- oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].
- self listSelectionAt: index put: dragOnOrOff.
- "event hand releaseMouseFocus: aMorph."
!
Item was changed:
----- Method: PluggableListMorphOfMany>>mouseMove: (in category 'event handling') -----
mouseMove: event
"The mouse has moved, as characterized by the event provided. Adjust the scrollbar, and alter the selection as appropriate"
+ | row index |
- | oldIndex oldVal row index |
event position y < self top
ifTrue:
[scrollBar scrollUp: 1.
row := self rowAtLocation: scroller topLeft + (1 @ 1)]
ifFalse:
[row := event position y > self bottom
ifTrue:
[scrollBar scrollDown: 1.
self rowAtLocation: scroller bottomLeft + (1 @ -1)]
ifFalse: [ self rowAtLocation: event position]].
row = 0 ifTrue: [^super mouseDown: event].
index := self modelIndexFor: row.
model okToChange ifFalse: [^self]. "No change if model is locked"
+ dragOnOrOff ifNil: [
+ "Was not set at mouse down, which means the mouse must have gone down in an area where there was no list item"
+ dragOnOrOff := (self listSelectionAt: index) not].
- dragOnOrOff ifNil:
- ["Was not set at mouse down, which means the mouse must have gone down in an area where there was no list item"
- dragOnOrOff := (self listSelectionAt: index) not].
+ self changeModelSelection: index.
+ self listSelectionAt: index put: dragOnOrOff.!
- "Set meaning for subsequent dragging of selection"
- oldIndex := self getCurrentSelectionIndex.
- oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].
-
- "Set or clear new primary selection (listIndex)"
- dragOnOrOff
- ifTrue: [self changeModelSelection: index]
- ifFalse: [self changeModelSelection: 0].
-
- "Need to restore the old one, due to how model works, and set new one."
- oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].
- self listSelectionAt: index put: dragOnOrOff.
- !
Item was added:
+ ----- Method: PluggableListMorphOfMany>>specialKeyPressed: (in category 'model access') -----
+ specialKeyPressed: asciiValue
+
+ asciiValue = Character space asciiValue
+ ifTrue: [ | index |
+ index := self getCurrentSelectionIndex.
+ self
+ listSelectionAt: index
+ put: ((self listSelectionAt: index) not).
+ ^ self].
+
+ super specialKeyPressed: asciiValue.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1533.mcz
==================== Summary ====================
Name: Morphic-ct.1533
Author: ct
Time: 20 September 2019, 8:54:34.318726 pm
UUID: 38b7bc64-e4de-cf41-b55c-f9dcb6a83340
Ancestors: Morphic-ct.1532
Fix a bug in MorphicProject initialization. If the fill style is a GradientFill and does not get copied, later changes will affect both worlds, wich does not seem desirable to me in any manner.
=============== Diff against Morphic-ct.1532 ===============
Item was changed:
----- Method: MorphicProject>>setWorldBackground: (in category 'initialize') -----
setWorldBackground: force
((world hasProperty: #hasCustomBackground) and: [force not])
ifTrue: [^ self].
"If the user has a custom background, propagate it into the new project."
((Project current ~~ self and: [Project current isMorphic]) and: [Project current world hasProperty: #hasCustomBackground])
ifTrue: [
+ world fillStyle: Project current world fillStyle veryDeepCopy.
- world fillStyle: Project current world fillStyle.
world setProperty: #hasCustomBackground toValue: true]
ifFalse: [
world removeProperty: #hasCustomBackground.
world fillStyle: (self userInterfaceTheme background ifNil: [self class defaultFill])].!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1530.mcz
==================== Summary ====================
Name: Morphic-ct.1530
Author: ct
Time: 20 September 2019, 8:32:50.756726 pm
UUID: 9f75febe-0f2e-1c4d-8322-a2647486ec38
Ancestors: Morphic-mt.1526
Align the formatting in a method comment ;)
=============== Diff against Morphic-mt.1526 ===============
Item was changed:
----- Method: Morph>>hResizing (in category 'layout-properties') -----
hResizing
"Layout specific. This property describes how the receiver should be resized with respect to its owner and its children. Possible values are:
#rigid - do not resize the receiver
#spaceFill - resize to fill owner's available space
+ #shrinkWrap - resize to fit children
- #shrinkWrap - resize to fit children
"
| props |
props := self layoutProperties.
^props ifNil:[#rigid] ifNotNil:[props hResizing].!