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

Marcel Taeumel marcel.taeumel at hpi.de
Wed Aug 24 11:35:57 UTC 2022


Can we avoid #respondsTo: by just implementing #makeMeVisible in Morph?

Best,
Marcel
Am 24.08.2022 12:16:17 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.2032.mcz

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

Name: Morphic-ct.2032
Author: ct
Time: 24 August 2022, 12:15:59.039424 pm
UUID: 385fbab8-ecc3-9f42-8b04-5ce73768f082
Ancestors: Morphic-ct.2031

Proposal: After resizing the display, also make all open dialog windows and progress morphs visible.

=============== Diff against Morphic-ct.2031 ===============

Item was added:
+ ----- Method: DialogWindow>>makeMeVisible (in category 'updating') -----
+ makeMeVisible
+ "Assure that the receiver is visible within the current world bounds."
+
+ self world extent > (0 @ 0) ifFalse: [^ self].
+
+ ((self world bounds insetBy: (0 @ 0 corner: self firstSubmorph height 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 position: (RealEstateAgent initialFrameFor: self initialExtent: self extent world: self world) topLeft.!

Item was changed:
----- Method: PasteUpMorph>>fullRepaintNeeded (in category 'world state') -----
fullRepaintNeeded

worldState doFullRepaint.
+ self submorphsDo: [:morph |
+ (morph respondsTo: #makeMeVisible)
+ ifTrue: [morph makeMeVisible]].
+ SystemProgressMorph fullRepaintNeeded.!
- SystemWindow windowsIn: self
- satisfying: [:w | w makeMeVisible. false].
-
- !

Item was added:
+ ----- Method: SystemProgressMorph class>>fullRepaintNeeded (in category 'class initialization') -----
+ fullRepaintNeeded
+
+ UniqueInstance ifNotNil: [UniqueInstance recenter].!

Item was changed:
+ ----- Method: SystemWindow>>makeMeVisible (in category 'updating') -----
+ makeMeVisible
+ "Assure that the receiver is visible within the current world bounds."
- ----- Method: SystemWindow>>makeMeVisible (in category 'drawing') -----
- makeMeVisible

+ self world extent > (0 @ 0) ifFalse: [^ self].
- self world extent > (0 at 0) ifFalse: [^ self].

+ ((self world bounds insetBy: (0 @ 0 corner: self labelHeight asPoint))
- ((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 position: (self isCollapsed
+ ifTrue: [RealEstateAgent assignCollapsePointFor: self]
+ ifFalse: [(RealEstateAgent initialFrameFor: self initialExtent: self extent world: self world) topLeft]).!
- self isCollapsed
- ifTrue: [self position: (RealEstateAgent assignCollapsePointFor: self)]
- ifFalse: [self position: (RealEstateAgent initialFrameFor: self initialExtent: self extent world: self world) topLeft].
-
- !


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


More information about the Squeak-dev mailing list