'From etoys2.1 of 26 July 2007 [latest update: #1546] on 11 August 2007 at 2:51:18 am'! "Change Set: collapseBelowSugar-sw Date: 11 August 2007 Author: Scott Wallace Exclude the area of the Sugar bar from the space considered suitable for locating collapsed window-tabs when the #sugarNavigator preference is true."! !RealEstateAgent class methodsFor: 'collapse' stamp: 'sw 8/11/2007 02:08'! assignCollapseFrameFor: aSSView "Offer up a location along the left edge of the screen for a collapsed SSView. Make sure it doesn't overlap any other collapsed frames." | grid otherFrames topLeft viewBox collapsedFrame extent newFrame verticalBorderDistance top | grid _ 8. verticalBorderDistance _ 8. aSSView isMorph ifTrue: [otherFrames _ (SystemWindow windowsIn: aSSView world satisfying: [:w | w ~= aSSView]) collect: [:w | w collapsedFrame] thenSelect: [:rect | rect notNil]. viewBox _ self reduceByFlaps: aSSView world viewBox] ifFalse: [otherFrames _ ScheduledControllers scheduledWindowControllers collect: [:aController | aController view ~= aSSView ifTrue: [aController view collapsedFrame]] thenSelect: [:rect | rect notNil]. viewBox _ Display boundingBox]. collapsedFrame _ aSSView collapsedFrame. extent _ collapsedFrame notNil ifTrue: [collapsedFrame extent] ifFalse: [aSSView isMorph ifTrue: [aSSView getRawLabel width + aSSView labelWidgetAllowance @ (aSSView labelHeight + 2)] ifFalse: [(aSSView labelText extent x + 70) @ aSSView labelHeight min: aSSView labelDisplayBox extent]]. collapsedFrame notNil ifTrue: [(otherFrames anySatisfy: [:f | collapsedFrame intersects: f]) ifFalse: ["non overlapping" ^ collapsedFrame]]. top _ viewBox top + verticalBorderDistance. [topLeft _ viewBox left @ top. newFrame _ topLeft extent: extent. newFrame bottom <= (viewBox height - verticalBorderDistance)] whileTrue: [(otherFrames anySatisfy: [:w | newFrame intersects: w]) ifFalse: ["no overlap" ^ newFrame]. top _ top + grid]. "If all else fails... (really too many wins here)" ^ Preferences sugarNavigator ifTrue: [0 @ 75 extent: extent] ifFalse: [0 @ 0 extent: extent]! ! !RealEstateAgent class methodsFor: 'private' stamp: 'sw 8/11/2007 02:06'! reduceByFlaps: aScreenRect "Return a rectangle that won't interfere with default shared flaps" Flaps sharedFlapsAllowed ifFalse: [^ aScreenRect copy]. Preferences sugarNavigator ifTrue: "olpc screen" [^ (aScreenRect topLeft + (18@75)) corner: (aScreenRect bottomRight - (18 @ 18))] ifFalse: "otherwise" [(Flaps globalFlapTabsIfAny allSatisfy: [:ft | ft flapID = 'Painting' translated or: [ft edgeToAdhereTo == #bottom]]) ifTrue: [^ aScreenRect withHeight: aScreenRect height - 18] ifFalse: [^ aScreenRect insetBy: 18]]! ! !RealEstateAgent class reorganize! ('iniitial frame' initialFrameFor: initialFrameFor:initialExtent: initialFrameFor:initialExtent:world: initialFrameFor:world: strictlyStaggeredInitialFrameFor:initialExtent: strictlyStaggeredInitialFrameFor:initialExtent:world:) ('parameters' maximumUsableArea maximumUsableAreaInWorld: screenTopSetback scrollBarSetback windowColumnsDesired windowRowsDesired) ('collapse' assignCollapseFrameFor: assignCollapsePointFor:) ('initialization' initialize) ('standard values' standardPositions standardPositionsInWorld: standardWindowExtent) ('private' reduceByFlaps:) !