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

commits at source.squeak.org commits at source.squeak.org
Fri Feb 21 13:58:56 UTC 2020


Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1629.mcz

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

Name: Morphic-ct.1629
Author: ct
Time: 21 February 2020, 2:58:49.83258 pm
UUID: 4bdab5e6-1c05-9e49-a5bf-8e609dd5392c
Ancestors: Morphic-mt.1628

Refactor SystemWindow >> makeMeVisible by adding a template method

This does not have a direct benefit for the trunk, but it makes it easier to extend the system, via extension methods or subclasses. (Concretely, I would like to use this hook for WindowAcrobatics without overriding the whole readjustment implementation.) Plus, it improves readability :-)

=============== Diff against Morphic-mt.1628 ===============

Item was changed:
  ----- Method: SystemWindow>>makeMeVisible (in category 'drawing') -----
  makeMeVisible 
  
+ 	^ self makeMeVisibleIn: self worldBounds!
- 	self world extent > (0 at 0) ifFalse: [^ self].
- 
- 	((self world bounds insetBy: (0 at 0 corner: self labelHeight asPoint))
- 		containsPoint: self position) ifTrue: [^ self "OK -- at least my top left is visible"].
- 
- 	"window not on screen (probably due to reframe) -- move it now"
- 	self isCollapsed
- 		ifTrue: [self position: (RealEstateAgent assignCollapsePointFor: self)]
- 		ifFalse: [self position: (RealEstateAgent initialFrameFor: self initialExtent: self extent world: self world) topLeft].
- 
- !

Item was added:
+ ----- Method: SystemWindow>>makeMeVisibleIn: (in category 'drawing') -----
+ makeMeVisibleIn: aRectangle
+ 
+ 	aRectangle hasPositiveExtent ifFalse: [^ self].
+ 
+ 	((aRectangle insetBy: (0 at 0 corner: self labelHeight asPoint))
+ 		containsPoint: self position)
+ 			ifTrue: [^ self "OK -- at least my top left is visible"].
+ 
+ 	"window not on screen (probably due to reframe) -- move it now"
+ 	self isCollapsed
+ 		ifTrue: [self position: (RealEstateAgent assignCollapsePointFor: self)]
+ 		ifFalse: [self position: (RealEstateAgent initialFrameFor: self initialExtent: self extent world: self world) topLeft].
+ 
+ !



More information about the Squeak-dev mailing list