[squeak-dev] The Inbox: MorphicExtras-dtl.210.mcz

David T. Lewis lewis at mail.msen.com
Sat Sep 30 15:09:29 UTC 2017


This is my attempt to fix a problem with positioning of system windows
in a project that has flaps enabled. I am not certain of the intent of
#reduceByFlaps: because the previous logic may have been trying to
accommodate Etoys geometry, and I do know know if this changee will have
broken something in that regard.

I also do not know if the check to prevent obscuring flaps along the top
margin is actually needed at all, since a repositioned window can cover
the flaps along the left, right, and bottom margins anyway.

Dave


On Sat, Sep 30, 2017 at 03:01:06PM +0000, commits at source.squeak.org wrote:
> David T. Lewis uploaded a new version of MorphicExtras to project The Inbox:
> http://source.squeak.org/inbox/MorphicExtras-dtl.210.mcz
> 
> ==================== Summary ====================
> 
> Name: MorphicExtras-dtl.210
> Author: dtl
> Time: 30 September 2017, 11:00:57.627669 am
> UUID: 4c13263d-1a0c-4857-8906-4ea09598f70b
> Ancestors: MorphicExtras-tpr.209
> 
> Reimplement RealEstateAgent class>>reduceByFlaps: to protect margins for size of flap handles, but no special case logic for 'Painting' flap, and do not reduce margins by 64 in any case.
> 
> This affects placement of SystemWindows, which avoids covering top flaps with a repositioned window. The previous implementation prevented placement of windows at the top portion of the display area if flaps were enabled in a project.
> 
> =============== Diff against MorphicExtras-tpr.209 ===============
> 
> Item was changed:
>   ----- Method: RealEstateAgent class>>reduceByFlaps: (in category '*MorphicExtras-utilities') -----
>   reduceByFlaps: aScreenRect 
>   	"Return a rectangle that won't interfere with default shared flaps"
>   
> + 	| top bottom left right |
>   	Flaps sharedFlapsAllowed ifFalse: [^ aScreenRect copy].
> + 
> + 	top := bottom := left := right := 0.
> + 	Flaps globalFlapTabs do: [ :ft | | w h |
> + 			w := ft width.
> + 			h := ft height.
> + 			ft edgeToAdhereTo
> + 				caseOf: {
> + 					[ #top ] -> [ top := top max: h ].
> + 					[ #bottom ] -> [ bottom := bottom max: h ] .
> + 					[ #left ] -> [ left := left max: w ] .
> + 					[ #right ] -> [ right := right max: w ] .
> + 				}
> + 				otherwise: [] ].
> + 	^ Rectangle
> + 		origin: aScreenRect origin + (left @ top)
> + 		extent: aScreenRect extent - (bottom @ right).
> + !
> - 	(Flaps globalFlapTabsIfAny allSatisfy:
> - 			[:ft | ft flapID = 'Painting' translated or: [ft edgeToAdhereTo == #bottom]])
> - 		ifTrue: [^ aScreenRect withHeight: aScreenRect height - 18]
> - 		ifFalse: [^ aScreenRect insetBy: 64]!
> 
> 


More information about the Squeak-dev mailing list