Christoph Thiede uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-ct.1428.mcz
==================== Summary ====================
Name: System-ct.1428 Author: ct Time: 12 October 2023, 8:21:45.324009 pm UUID: f64b78ad-e590-5244-a502-69ac93d54093 Ancestors: System-ct.1427, System-ct.1424
Merges System-ct.1424: Revises RealEstateAgent logic for placing collapsed windows to deal with more windows than fit in one column by arranging them next to each other. Speeds up the logic for high-DPI displays by honoring the current scaleFactor.
=============== Diff against System-ct.1427 ===============
Item was changed: ----- Method: RealEstateAgent class>>assignCollapseFrameFor: (in category 'utilities') ----- 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 verticalBorderDistance horizontalBorderDistance otherFrames viewBox collapsedFrame extent top column countInColumn topLeft newFrame row rowLeft rowFrame | + grid := 8 px. + verticalBorderDistance := 8 px. + horizontalBorderDistance := 8 px. + - | 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 maximumUsableAreaInWorld: aSSView world] ifFalse: [otherFrames := ScheduledControllers scheduledWindowControllers collect: [:aController | aController view ~= aSSView ifTrue: [aController view collapsedFrame]] thenSelect: [:rect | rect notNil]. viewBox := Display boundingBox]. + otherFrames sort: [:w | w right] ascending. collapsedFrame := aSSView collapsedFrame. extent := collapsedFrame notNil ifTrue: [collapsedFrame extent] ifFalse: [aSSView isMorph + ifTrue: [aSSView getRawLabel width + aSSView labelWidgetAllowance @ (aSSView labelHeight + 2 px)] + ifFalse: [(aSSView labelText extent x + 70 px) @ aSSView labelHeight - 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]]. + + column := 0. + countInColumn := nil. + [countInColumn = 0] + whileFalse: + [top := viewBox top + verticalBorderDistance. + countInColumn := 0. + [topLeft := viewBox left @ top. + newFrame := topLeft extent: extent. + newFrame bottom <= (viewBox height - verticalBorderDistance)] + whileTrue: + [row := otherFrames select: [:w | newFrame intersects: w]. + column > 0 ifFalse: [rowFrame := newFrame] ifTrue: [ + rowLeft := ((otherFrames collect: [:w | w right]) take: column) last + horizontalBorderDistance. + rowFrame := newFrame translateBy: (rowLeft @ 0). + row := otherFrames select: [:w | rowFrame intersects: w]]. + (viewBox containsRect: rowFrame) ifTrue: [ + row ifEmpty: ["no overlap" + ^ rowFrame]. + countInColumn := countInColumn + 1]. + top := top + grid]. + column := column + 1]. + + "If all else fails... (really too many wins here)" - 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 to many wins here)" aSSView isMorph ifTrue:[ Project current showWorldMainDockingBar ifTrue:[^ (0 @ Project current world mainDockingBars first height) extent: extent]]. ^ 0 @ 0 extent: extent!
Item was changed: ----- Method: RealEstateAgent class>>assignCollapsePointFor: (in category 'utilities') ----- assignCollapsePointFor: 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 viewBox column countInColumn y row topLeft currentRowLeft rowLeft | + grid := 24 px. "should be mult of 8, since manual move is gridded by 8 px" - | grid otherFrames y free topLeft viewBox | - grid := 24. "should be mult of 8, since manual move is gridded by 8" aSSView isMorph ifTrue: [otherFrames := (SystemWindow windowsIn: aSSView world satisfying: [:w | true]) collect: [:w | w collapsedFrame] thenSelect: [:rect | rect notNil]. viewBox := self maximumUsableAreaInWorld: aSSView world] ifFalse: [otherFrames := ScheduledControllers scheduledWindowControllers collect: [:aController | aController view collapsedFrame] thenSelect: [:rect | rect notNil]. viewBox := Display boundingBox]. + otherFrames sort: [:w | w right] ascending. + + column := 0. + countInColumn := nil. + [countInColumn = 0] + whileFalse: + [y := viewBox top. + countInColumn := 0. + [(y := y + grid) <= (viewBox height - grid)] + whileTrue: + [topLeft := viewBox left@y. + row := otherFrames select: [:w | topLeft = w topLeft]. + column > 0 ifFalse: [currentRowLeft := topLeft] ifTrue: [ + rowLeft := ((otherFrames collect: [:w | w right]) take: column) last + grid. + currentRowLeft := topLeft translateBy: (rowLeft @ 0). + row := otherFrames select: [:w | currentRowLeft = w topLeft]]. + (viewBox containsPoint: topLeft) ifTrue: [ + row ifEmpty: ["no overlap" + ^ topLeft]. + countInColumn := countInColumn + 1]]. + column := column + 1]. + - y := viewBox top. - [(y := y + grid) <= (viewBox height - grid)] - whileTrue: - [topLeft := viewBox left@y. - free := true. - otherFrames do: [:w | free := free & (topLeft ~= w topLeft)]. - free ifTrue: [^ topLeft]]. "If all else fails..." ^ 0 @ 0!
packages@lists.squeakfoundation.org