[Pkg] The Trunk: Morphic-mt.1999.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 3 13:57:23 UTC 2022


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1999.mcz

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

Name: Morphic-mt.1999
Author: mt
Time: 3 June 2022, 3:57:17.981722 pm
UUID: fa65a07a-3d2b-8544-b5a9-9ad67f734549
Ancestors: Morphic-mt.1998

Somewhat fixes the UI issue with "Find Workspace..." sub-menu in the "Windows" menu by delegation the choice to an extra dialog window.

(I proposed this alternative approach to Eliot (eem) a few weeks ago to which he agreed. I also bumped the label size from 128 to 512 characters.)

=============== Diff against Morphic-mt.1998 ===============

Item was added:
+ ----- Method: TheWorldMainDockingBar>>findWorkspace (in category 'submenu - windows') -----
+ findWorkspace
+ 
+ 	| allWorkspaces labels values |
+ 	allWorkspaces := Set new.
+ 	Project allMorphicProjects do:
+ 		[:project|
+ 		(self allVisibleWindowsIn: project world) do:
+ 			[:window|
+ 			(window model isKindOf: Workspace) ifTrue:
+ 				[allWorkspaces add:
+ 					{	window model.
+ 						window.
+ 						project.
+ 						window model contents ifEmpty:
+ 							[(window model dependents detect: [:d| d isTextView] ifNone: nil) textMorph contents] }]]].
+ 	allWorkspaces isEmpty ifTrue:
+ 		[^ self inform: 'No workspaces found.' translated].
+ 	"Sort workspaces with non-empty ones first..."
+ 	labels := OrderedCollection new.
+ 	values := OrderedCollection new.
+ 	(allWorkspaces sorted:
+ 		[:t1 :t2|
+ 		t1 last isEmpty == t2 last isEmpty
+ 			ifTrue: [t1 second label <= t2 second label]
+ 			ifFalse: [t1 last notEmpty]]) do:
+ 		[:tuple|
+ 		labels add: tuple second label, ': ', ((tuple last asString contractTo: 512) ifEmpty: ['(empty)']).
+ 		values add: (MessageSend receiver: self selector: #selectWorkspace:window:inProject:contents: arguments: tuple)].
+ 	(Project uiManager
+ 		chooseFrom: labels
+ 		values: values
+ 		title: 'Find Workspace' translated) value.!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu - windows') -----
  listWindowsOn: menu
  
  	| windows |
  	menu
  		addLine;
  		add: 'Collapse all windows' target: (Project current world) selector: #collapseAllWindows;
  		addItem: [:item | item 
  			contents: 'Find Workspace...';
+ 			target: self;
+ 			selector: #findWorkspace];
- 			subMenuUpdater: self
- 			selector: #workspacesMenuFor:
- 			arguments: #()];
  		addLine;
  		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;
  		addLine.
  					
  	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 ] ] ].!

Item was removed:
- ----- Method: TheWorldMainDockingBar>>workspacesMenuFor: (in category 'submenu - windows') -----
- workspacesMenuFor: anUpdatingMenuMorph
- 
- 	| allWorkspaces |
- 	allWorkspaces := Set new.
- 	Project allMorphicProjects do:
- 		[:project|
- 		(self allVisibleWindowsIn: project world) do:
- 			[:window|
- 			(window model isKindOf: Workspace) ifTrue:
- 				[allWorkspaces add:
- 					{	window model.
- 						window.
- 						project.
- 						window model contents ifEmpty:
- 							[(window model dependents detect: [:d| d isTextView] ifNone: nil) textMorph contents] }]]].
- 	allWorkspaces isEmpty ifTrue:
- 		[^anUpdatingMenuMorph addItem:
- 			[:item | item
- 				contents: 'no workspaces found']].
- 	"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) ifEmpty: ['(empty)']);
- 				target: self;
- 				selector: #selectWorkspace:window:inProject:contents:;
- 				arguments: tuple]]!

Item was changed:
+ (PackageInfo named: 'Morphic') postscript: 'TheWorldMainDockingBar updateInstances. "Updates menu for Windows > Find Workspace ..."'!
- (PackageInfo named: 'Morphic') postscript: 'Preferences maxBalloonHelpLineLength: 45.
- 
- "See commentary in MorphicProject >> #startUpActions."
- WorldState disableDeferredUpdates: Smalltalk platformName = ''Mac OS''.'!



More information about the Packages mailing list