[squeak-dev] The Trunk: Morphic-eem.1786.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Nov 4 19:44:12 UTC 2021


Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1786.mcz

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

Name: Morphic-eem.1786
Author: eem
Time: 4 November 2021, 12:44:06.340704 pm
UUID: 6a2f11a1-29ae-4254-b9a7-585512357c51
Ancestors: Morphic-mt.1785

Add a Find Workspace... item to teh end of the Find Window menu.  This finds and activates a workspace in any project (my life has too many projecvts with too many workspaces in them to lve without this kind of help).

Abstracting the facility to search for other kinds of windows is left as an exercise to the reader (I don't see the need for being able to find other than workspaces, but that might be just me).

Needs System-eem.1245.

=============== Diff against Morphic-mt.1785 ===============

Item was added:
+ ----- Method: MorphicProject>>topMorphicProject (in category 'accessing') -----
+ topMorphicProject
+ 	parentProject == self ifTrue: [^self].
+ 	parentProject ifNil: [self nilParentError].
+ 	^parentProject isMorphic
+ 		ifTrue: [parentProject topMorphicProject]
+ 		ifFalse: [self]!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu - windows') -----
  listWindowsOn: menu
  
  	| windows |
  	windows := self allVisibleWindows sorted: [:winA :winB |
  		((winA model isNil or: [winB model isNil]) or: [winA model name = winB model name])
  			ifTrue: [winA label < winB label]
  			ifFalse: [winA model name < winB model name]].
  	windows ifEmpty: [ 
  		menu addItem: [ :item | 
  			item
  				contents: 'No Windows' translated;
  				isEnabled: false ] ].
  	windows do: [ :each |
  		| windowColor |
  		windowColor := (each model respondsTo: #windowColorToUse)
  			ifTrue: [each model windowColorToUse]
  			ifFalse: [UserInterfaceTheme current get: #uniformWindowColor for: Model]. 
  		menu addItem: [ :item |
  			item 
  				contents: (self windowMenuItemLabelFor: each);
  				icon: (self colorIcon: windowColor);
  				target: each;
  				selector: #comeToFront;
  				subMenuUpdater: self
  				selector: #windowMenuFor:on:
  				arguments: { each };
  				action: [ each beKeyWindow; expand ] ] ].
  	menu
  		addLine;
  		add: 'Collapse all windows' target: (Project current world) selector: #collapseAllWindows;
  		add: 'Close all windows' target: self selector: #closeAllWindowsUnsafe;
  		addItem: [:item | item
  			contents: 'Close all windows without changes';
  			target: self;
  			icon: MenuIcons smallBroomIcon;
  			selector: #closeAllWindows];
+ 		add: 'Close all windows but workspaces' target: self selector: #closeAllWindowsButWorkspaces;
+ 		addItem:
+ 			[ :item |
+ 			item 
+ 				contents: 'Find Workspace...';
+ 				target: self;
+ 				selector: #findWorkspace;
+ 				subMenuUpdater: self
+ 					selector: #workspacesMenuFor:
+ 						arguments: #()]!
- 		add: 'Close all windows but workspaces' target: self selector: #closeAllWindowsButWorkspaces.!

Item was added:
+ ----- Method: TheWorldMainDockingBar>>selectWorkspace:window:inProject:contents: (in category 'submenu - windows') -----
+ selectWorkspace: aWorkspace window: aSystemWindow inProject: aMorphicProject contents: contents
+ 	aMorphicProject
+ 		addDeferredUIMessage: [aSystemWindow comeToFront];
+ 		enter "Does nothing if already the current project..."
+ 	!

Item was added:
+ ----- Method: TheWorldMainDockingBar>>workspacesMenuFor: (in category 'submenu - windows') -----
+ workspacesMenuFor: anUpdatingMenuMorph
+ 	| allWorkspaces |
+ 	allWorkspaces := Set new.
+ 	Project current topMorphicProject withChildrenDo:
+ 		[:project|
+ 		project world submorphs do:
+ 			[:m|
+ 			(m model isKindOf: Workspace) ifTrue:
+ 				[allWorkspaces add:
+ 					{	m model.
+ 						m.
+ 						project.
+ 						m model contents ifEmpty:
+ 							[(m model dependents detect: [:d| d isTextView] ifNone: nil) textMorph contents] }]]].
+ 	"Sort workspaces with non-empty ones first..."
+ 	(allWorkspaces sorted:
+ 		[:t1 :t2|
+ 		t1 last isEmpty == t2 last isEmpty
+ 			ifTrue: [t1 second label <= t2 second label]
+ 			ifFalse: [t1 last notEmpty]]) do:
+ 		[:tuple|
+ 		anUpdatingMenuMorph addItem:
+ 			[:item | item
+ 				contents: tuple second label, ': ', (tuple last asString contractTo: 128);
+ 				target: self;
+ 				selector: #selectWorkspace:window:inProject:contents:;
+ 				arguments: tuple]]!



More information about the Squeak-dev mailing list