[squeak-dev] The Trunk: Morphic-cmm.1443.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Thu May 31 10:44:17 UTC 2018


Hey Chris,

I committed two changes to Connectors and FSM to address the issues for 5.2alpha:
http://www.squeaksource.com/Connectors/FSM-mt.47.mcz [http://www.squeaksource.com/Connectors/FSM-mt.47.mcz]
http://www.squeaksource.com/Connectors/Connectors-mt.208.mcz [http://www.squeaksource.com/Connectors/Connectors-mt.208.mcz]

Best,
Marcel
Am 31.05.2018 07:21:18 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hey Chris,

both #layoutChanged and #changed MUST work for all morphs even if the morph is not in a world or has no owner. Please revert this change and fix NCAAConnectorMorph instad. Otherwise, this could break test code easily.

Best,
Marcel
Am 30.05.2018 23:51:51 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1443.mcz

==================== Summary ====================

Name: Morphic-cmm.1443
Author: cmm
Time: 30 May 2018, 4:50:16.716113 pm
UUID: 2f269941-1afa-4615-9242-9e485ecd986e
Ancestors: Morphic-mt.1442

- When updating a borderStyle:, only signal changes if the receiver is in the world for them to be seen. This fixes:
NCAAConnectorMorph new
- When halo's are on a background Morph, and a foreground morph covering it is blue-clicked, transfer the halos to the clicked morph.
- Disable the new #balanceOffsets when Smart Splitters is enabled, unfortunately they currently don't play nicely together.

=============== Diff against Morphic-mt.1442 ===============

Item was changed:
----- Method: Morph>>borderStyle: (in category 'accessing') -----
borderStyle: aBorderStyle
-
aBorderStyle = self borderStyle ifTrue: [^ self].
-
"If we cannot draw the new border, accept at least its color and width."
((self canDrawBorder: aBorderStyle) or: [aBorderStyle isNil])
ifTrue: [self setProperty: #borderStyle toValue: aBorderStyle]
ifFalse: [
self borderStyle
width: aBorderStyle width;
baseColor: aBorderStyle baseColor].
-
self borderStyle trackColorFrom: self.
+ self isInWorld ifTrue:
+ [ self
+ layoutChanged;
+ changed ]!
-
- self
- layoutChanged;
- changed.!

Item was changed:
----- Method: PasteUpMorph>>tryInvokeHalo: (in category 'events-processing') -----
+ tryInvokeHalo: aUserInputEvent
+ "Invoke halos around the top-most world container at aUserInputEvent's #position. If it was already halo'd, zero-in on its next inward component morph at that position. Holding Shift during the click reverses this traversal order."
+ | stack target owners |
+ Preferences noviceMode ifTrue: [^self ].
+ Morph haloForAll ifFalse: [^self].
+ "the stack is the top-most morph to bottom-most."
+ stack := (self morphsAt: aUserInputEvent position unlocked: true) select: [ : each | each wantsHaloFromClick ].
+ stack ifEmpty: [^self].
+ target :=
+ aUserInputEvent hand halo
+ ifNil: [ stack first ]
+ ifNotNil:
+ [ : existingHalo |
+ stack allButFirst "halo's are always topmost on the stack"
+ detect: [ : each | each owner == self ]
+ ifFound:
+ [ : topMostWhereClicked |
+ (existingHalo target withAllOwners includes: topMostWhereClicked)
+ ifTrue: [ "No invocation needed. Halo will handle transfer itself." ^self ]
+ ifFalse:
+ [ "Transfer halo to new world container."
+ aUserInputEvent hand removeHalo.
+ aUserInputEvent shiftPressed
+ ifTrue: [ stack second ]
+ ifFalse: [ topMostWhereClicked ] ] ]
+ ifNone: ["Okay, invoke halos on the world." self ] ].
+ "With a modifier, we want the innermost, otherwise the outermost."
+ owners := target withAllOwners select: [ : each | each wantsHaloFromClick ].
+ "the last owner is expected to be self."
+ target := aUserInputEvent shiftPressed ifTrue: [ owners first ] ifFalse: [ owners at: owners size-1 ifAbsent: [self] ].
+ "Now that we have the target, show the halo. Abort event dispatching, too, to avoid confusion."
+ aUserInputEvent hand newMouseFocus: target event: aUserInputEvent.
+ target invokeHaloOrMove: aUserInputEvent.
+ "aUserInputEvent has been consumed, don't let it cause any further side-effects."
+ aUserInputEvent ignore!
- tryInvokeHalo: anEvent
-
- | innerMost target |
- anEvent hand halo ifNotNil: [^ self "No invocation needed. Halo will handle transfer itself."].
- Preferences noviceMode ifTrue: [^ self "No halo in novice mode."].
- Morph haloForAll ifFalse: [^ self].
-
- innerMost := (self morphsAt: anEvent position unlocked: true) first.
-
- "1) Try to use innermost morph but skip all the ones that do not want to show a halo along the owner chain."
- target := innerMost.
- [target isNil or: [target wantsHaloFromClick]]
- whileFalse: [target := target owner].
- target ifNil: [^ self].
-
- "2) Without a modifier, which is normal, find the outermost container for that inner morph."
- (innerMost == self or: [anEvent shiftPressed]) ifFalse: [
- | previousTargets |
- previousTargets := OrderedCollection new.
- [target notNil and: [target owner ~~ self]] whileTrue: [
- previousTargets add: target.
- target := target owner].
- target ifNil: [^ self].
- [previousTargets isEmpty or: [target wantsHaloFromClick]] whileFalse: [
- target := previousTargets removeLast].
- target wantsHaloFromClick ifFalse: [^ self]].
-
- "3) Now that we have the target, show the halo. Abort event dispatching, too, to avoid confusion."
- anEvent hand newMouseFocus: target event: anEvent.
- target invokeHaloOrMove: anEvent.
- anEvent ignore.!

Item was changed:
----- Method: ProportionalSplitterMorph>>mouseUp: (in category 'events') -----
mouseUp: anEvent
+ (self bounds containsPoint: anEvent cursorPoint) ifFalse: [ anEvent hand showTemporaryCursor: nil ].
+ self class fastSplitterResize ifTrue: [ self updateFromEvent: anEvent ].
+ traceMorph ifNotNil:
+ [ traceMorph delete.
+ traceMorph := nil ].
- (self bounds containsPoint: anEvent cursorPoint)
- ifFalse: [anEvent hand showTemporaryCursor: nil].
- self class fastSplitterResize
- ifTrue: [self updateFromEvent: anEvent].
- traceMorph ifNotNil: [traceMorph delete. traceMorph := nil].
self color: self getOldColor.
+ "balanceOffsets currently disrupts Smart Splitter behavior."
+ (ProportionalSplitterMorph smartVerticalSplitters or: [ ProportionalSplitterMorph smartHorizontalSplitters ]) ifFalse: [ self balanceOffsets ]!
-
- self balanceOffsets!

Item was changed:
----- Method: ProportionalSplitterMorph>>step (in category 'events') -----
step
splitsTopAndBottom
ifTrue: [ self reduceTopBottomImbalance ]
ifFalse:
[ self reduceLeftRightImbalance abs > 1 ifTrue:
[ self splittersLeftDo:
[ : splitter | splitter reduceLeftRightImbalance ].
self splittersRightDo:
+ [ : splitter | splitter reduceLeftRightImbalance ] ] ]!
- [ : splitter | splitter reduceLeftRightImbalance ] ] ].
- self balanceOffsets!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20180531/c11479bb/attachment.html>


More information about the Squeak-dev mailing list