[squeak-dev] The Inbox: Morphic-mva.1334.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Apr 7 16:06:59 UTC 2017


A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-mva.1334.mcz

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

Name: Morphic-mva.1334
Author: mva
Time: 7 April 2017, 6:05:52.930071 pm
UUID: cf00184d-16fc-470f-bda7-3464f82b28f0
Ancestors: Morphic-cmm.1333

A quick hack - proof of concept - as a reaction to  "I'd like to see system windows collapse when dropped in the menu bar".
http://lists.squeakfoundation.org/pipermail/squeak-dev/2017-April/194079.html

Drag a system window to the menu bar - it will collapse.
Drag it out to the world - it will expand.

Caveats. 
When you drag a window in world - it will expand when you drop it.
When you collapse a window in world  - it will will stay up. You can send it back with the 'send to back' menu option in the triangle menu on the right.
The windows you have put into the menu bar have an unnerving tendency to jump to the left of the menu bar putting themselves before the menu.

=============== Diff against Morphic-cmm.1333 ===============

Item was changed:
  ----- Method: SystemWindow>>collapseOrExpand (in category 'resize/collapse') -----
  collapseOrExpand
  	"Collapse or expand the window, depending on existing state"
  	| cf |
  	isCollapsed
  		ifTrue: 
  			["Expand -- restore panes to morphics structure"
  			isCollapsed := false.
  			self beKeyWindow.  "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' translated].
  			self setBoundsWithFlex: fullFrame.
  			paneMorphs reverseDo: 
  					[:m |  self addMorph: m unlock.
  					self world startSteppingSubmorphsOf: m].
  			self addPaneSplitters.
  			(self hasProperty: #applyTheme) ifTrue: [
  				self removeProperty: #applyTheme.
  				self userInterfaceTheme applyTo: self allMorphs]]
  		ifFalse: 
  			["Collapse -- remove panes from morphics structure"
  			isCollapsed := true.
  			fullFrame := self getBoundsWithFlex.
  			"First save latest fullFrame"
  			paneMorphs do: [:m | m delete; releaseCachedState].
  			self removePaneSplitters.
  			self removeCornerGrips.
  			model modelSleep.
  			cf := self getCollapsedFrame.
  			(collapsedFrame isNil and: [Preferences collapseWindowsInPlace not]) ifTrue:
  				[collapsedFrame := cf].
  			self setBoundsWithFlex: cf.
  			collapseBox ifNotNil: [collapseBox setBalloonText: 'expand this window' translated ].
  			expandBox ifNotNil: [expandBox setBalloonText: 'expand this window' translated ].
+ 			].
- 			self sendToBack].
  	self layoutChanged!

Item was changed:
  ----- Method: SystemWindow>>justDroppedInto:event: (in category 'geometry') -----
  justDroppedInto: aMorph event: anEvent
  
+ 	(aMorph isKindOf: DockingBarMorph) ifTrue: [ self collapse ].
+ 	(aMorph isWorldMorph) ifTrue: [ self expand ].
  	isCollapsed
  		ifTrue: [self position: ((self position max: 0 at 0) grid: 8 at 8).
  				collapsedFrame := self bounds]
  		ifFalse: [fullFrame := self bounds].
  
  	self beKeyWindow.
  	self hasDropShadow: Preferences menuAppearance3d. "See #startDragFromLabel:."
  			
  	aMorph == self world ifTrue: [self assureLabelAreaVisible].
  
  	(Project uiManager openToolsAttachedToMouseCursor and: (self hasProperty: #initialDrop))
  		ifTrue: [
  			self removeProperty: #initialDrop.
  			(self submorphs detect: [:m | m isKindOf: BottomRightGripMorph] ifNone: [])
  				ifNotNil: [:grip | 
  					grip
  						referencePoint: anEvent position;
  						setProperty: #targetHadDropShadow toValue: true "See MorphicToolBuilder >> #open:".
  					self hasDropShadow: false.
  					anEvent hand newMouseFocus: grip]].
  			
  	^super justDroppedInto: aMorph event: anEvent!



More information about the Squeak-dev mailing list