[squeak-dev] The Inbox: Morphic-ct.1684.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Sep 17 15:34:19 UTC 2020


A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1684.mcz

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

Name: Morphic-ct.1684
Author: ct
Time: 17 September 2020, 5:33:51.858813 pm
UUID: 439b6c83-ed50-784c-83f2-bda2edbd6a03
Ancestors: Morphic-mt.1683

Refactors halo handle creation logic, increasing reusability in subclass SelectionMorph. Adds lasso icon to #addOrRemoveItems: handle. Also includes minor refactorings of two other Morph methods.

=============== Diff against Morphic-mt.1683 ===============

Item was changed:
  ----- Method: Morph>>addHandlesTo:box: (in category 'halos and balloon help') -----
  addHandlesTo: aHaloMorph box: box
+ 	"Add halo handles to the halo. Apply the halo filter if appropriate."
- 	"Add halo handles to the halo.  Apply the halo filter if appropriate"
  
- 	
  	aHaloMorph haloBox: box.
+ 	
+ 	Preferences haloSpecifications
+ 		select: [:spec | self
+ 			filterHaloSelector: spec addHandleSelector
+ 			inHalo: aHaloMorph]
+ 		thenDo: [:spec |
+ 			aHaloMorph
+ 				perform: spec addHandleSelector
+ 				with: spec].
+ 	
+ 	aHaloMorph innerTarget addOptionalHandlesTo: aHaloMorph box: box.!
- 	Preferences haloSpecifications  do:
- 		[:aSpec | | wantsIt aSelector | 
- 			aSelector :=  aSpec addHandleSelector.
- 			wantsIt := Preferences selectiveHalos
- 				ifTrue:
- 					[self wantsHaloHandleWithSelector: aSelector inHalo: aHaloMorph]
- 				ifFalse:
- 					[true].
- 			wantsIt ifTrue:
- 				[(#(addMakeSiblingHandle: addDupHandle:) includes: aSelector) ifTrue:
- 					[wantsIt := self preferredDuplicationHandleSelector = aSelector].
- 			wantsIt ifTrue:
- 				[aHaloMorph perform: aSelector with: aSpec]]].
- 
- 	aHaloMorph innerTarget addOptionalHandlesTo: aHaloMorph box: box!

Item was changed:
  ----- Method: Morph>>changeProportionalLayout (in category 'layout-menu') -----
  changeProportionalLayout
+ 
  	| layout |
+ 	((layout := self layoutPolicy) notNil and: [layout isProportionalLayout])
+ 		ifTrue: [^ self]. "already proportional layout"
+ 	self layoutPolicy: ProportionalLayout new.!
- 	((layout := self layoutPolicy) notNil and:[layout isProportionalLayout])
- 		ifTrue:[^self]. "already proportional layout"
- 	self layoutPolicy: ProportionalLayout new.
- 	self layoutChanged.!

Item was added:
+ ----- Method: Morph>>filterHaloSelector:inHalo: (in category 'halos and balloon help') -----
+ filterHaloSelector: aSelector inHalo: aHaloMorph
+ 
+ 	^ Preferences selectiveHalos ==> [
+ 		self wantsHaloHandleWithSelector: aSelector inHalo: aHaloMorph]
+ 			and: [(#(addMakeSiblingHandle: addDupHandle:) includes: aSelector) ==> [
+ 				self preferredDuplicationHandleSelector = aSelector]]!

Item was changed:
  ----- Method: Morph>>referencePosition: (in category 'rotate scale and flex') -----
  referencePosition: aPosition
  	"Move the receiver to match its reference position with aPosition"
+ 
  	| newPos intPos |
  	newPos := self position + (aPosition - self referencePosition).
  	intPos := newPos asIntegerPoint.
+ 	self position: (newPos = intPos 
+ 		ifTrue: [intPos]
+ 		ifFalse: [newPos]).!
- 	newPos = intPos 
- 		ifTrue:[self position: intPos]
- 		ifFalse:[self position: newPos].!

Item was removed:
- ----- Method: SelectionMorph>>addHandlesTo:box: (in category 'halos and balloon help') -----
- addHandlesTo: aHaloMorph box: box
- 	| onlyThese |
- 	aHaloMorph haloBox: box.
- 	onlyThese := #(addDismissHandle: addMenuHandle: addGrabHandle: addDragHandle: addDupHandle: addHelpHandle: addGrowHandle: addFontSizeHandle: addFontStyleHandle: addFontEmphHandle: addRecolorHandle:).
- 	Preferences haloSpecifications do:
- 		[:aSpec | (onlyThese includes: aSpec addHandleSelector) ifTrue:
- 				[aHaloMorph perform: aSpec addHandleSelector with: aSpec]].
- 	aHaloMorph innerTarget addOptionalHandlesTo: aHaloMorph box: box!

Item was changed:
  ----- Method: SelectionMorph>>addOptionalHandlesTo:box: (in category 'halos and balloon help') -----
  addOptionalHandlesTo: aHalo box: box
+ 
+ 	aHalo
+ 		addHandleAt: box leftCenter
+ 		color: Color lightBlue
+ 		icon: #Lasso
+ 		on: #mouseUp
+ 		send: #addOrRemoveItems:
+ 		to: self.!
- 	aHalo addHandleAt: box leftCenter color: Color blue icon: nil
- 		on: #mouseUp send: #addOrRemoveItems: to: self.!

Item was added:
+ ----- Method: SelectionMorph>>filterHaloSelector:inHalo: (in category 'halos and balloon help') -----
+ filterHaloSelector: aSelector inHalo: aHaloMorph
+ 
+ 	^ self permittedHaloHandles includes: aSelector!

Item was added:
+ ----- Method: SelectionMorph>>permittedHaloHandles (in category 'halos and balloon help') -----
+ permittedHaloHandles
+ 
+ 	^ #(addDebugHandle: addDismissHandle: addMenuHandle: addGrabHandle: addDragHandle: addDupHandle: addHelpHandle: addGrowHandle: addFontSizeHandle: addFontStyleHandle: addFontEmphHandle: addRecolorHandle:)!



More information about the Squeak-dev mailing list