'From Squeak3.2alpha of 2 October 2001 [latest update: #4525] on 21 November 2001 at 9:35:27 pm'! "Change Set: UncollapseToTop Date: 21 November 2001 Author: Dan Ingalls When uncollpasing a window, the system used first to expand it and then bring it to the front, resulting in lots of unnecessaryt screen repainting. This changeSet reverses the order, bringing the collapsed window forward first, then expanding it. "! !SystemWindow methodsFor: 'resize/collapse' stamp: 'di 11/21/2001 21:27'! collapseOrExpand "Collapse or expand the window, depending on existing state" | cf | isCollapsed ifTrue: ["Expand -- restore panes to morphics structure" isCollapsed _ false. self activate. "Bring to frint first" Preferences collapseWindowsInPlace ifTrue: [fullFrame := fullFrame align: fullFrame topLeft with: self getBoundsWithFlex topLeft] ifFalse: [collapsedFrame _ self getBoundsWithFlex]. collapseBox ifNotNil: [collapseBox setBalloonText: 'collapse this window']. self setBoundsWithFlex: fullFrame. paneMorphs reverseDo: [:m | self addMorph: m. self world startSteppingSubmorphsOf: m]] ifFalse: ["Collapse -- remove panes from morphics structure" isCollapsed _ true. fullFrame _ self getBoundsWithFlex. "First save latest fullFrame" paneMorphs do: [:m | m delete; releaseCachedState]. model modelSleep. cf := self getCollapsedFrame. (collapsedFrame isNil and: [Preferences collapseWindowsInPlace not]) ifTrue: [collapsedFrame _ cf]. self setBoundsWithFlex: cf. collapseBox ifNotNil: [collapseBox setBalloonText: 'expand this window']. expandBox ifNotNil: [expandBox setBalloonText: 'expand to full screen']]. self layoutChanged! !