[squeak-dev] The Inbox: Morphic-ct.1785.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Oct 4 15:13:42 UTC 2021


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

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

Name: Morphic-ct.1785
Author: ct
Time: 4 October 2021, 5:13:36.846947 pm
UUID: e5774334-8b07-7545-9ea5-5389620d51d0
Ancestors: Morphic-ul.1780

Revises proposal from Morphic-ct.1781 to rearrange menu items in the docking bar. For the sake of consistency, move the generic items to the top of the list not only in the changes menu but also in the do-it menu and in the windows menu. I argue that this way is more ergonomic for two reasons:

1. As opposed to variable items, generic items are the only constants in the menu which have the highest potential for being adopted by the muscle memory.
2. If the list gets very long, the accessibility of generic items is impaired (cf. steering law), which I consider more critical than the reduced accessibility of 1 out of 20 or 30 entries. Even worse, if the lists gets really huge, it might not fit into the height of the world (and we currently do not have scroll bars for menus).

+1s or -1s and your arguments wanted. :-)

=============== Diff against Morphic-ul.1780 ===============

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listChangesOn: (in category 'submenu - changes') -----
  listChangesOn: menu
  
+ 	menu defaultTarget: self.
+ 	menu addTranslatedList: #(
+ 		('Simple Change Sorter'			browseChanges)
+ 		('Dual Change Sorter'			browseChangesDual)
+ 		('Browse changed methods'	browseChangedMethods)
+ 		-
+ 		('( ... fetching changes ... )' 	nil)).
+ 	menu lastItem isEnabled: false.
+ 	
+ 	self flag: #hack. "To avoid relayout of static items when dynamic items with icons from below will added, add blank icons right now."
+ 	menu addBlankIconsIfNecessary: (MenuIcons blankIconOfWidth: RealEstateAgent defaultIconExtent x).
+ 	
+ 	[| latestMethodChanges latestClassChanges |
- 	| latestMethodChanges latestClassChanges|
  	latestMethodChanges := (Array streamContents: [:s |
  		ChangeSet current changedMethodsDo: [:method :changeType :dateAndTime :category |
  			s nextPut: { dateAndTime. method. changeType. category }]])
  			sorted: [:a :b | a first >= b first].
- 
- 	1 to: (10 min: latestMethodChanges size) do: [:index | | spec method |
- 		spec := latestMethodChanges at: index.
- 		method := spec second.
- 		menu addItem: [:item |
- 			item
- 				contents: ('{1} {2} \{{3}\} \{{4}\}' format: {method methodClass. method selector. spec fourth. method methodClass category}) ;
- 				target: ToolSet;
- 				balloonText: spec third asString;
- 				icon: ((#(remove addedThenRemoved) includes: spec third) ifTrue: [MenuIcons smallDeleteIcon] ifFalse: [
- 					spec third = #add ifTrue: [MenuIcons smallNewIcon] ifFalse: [MenuIcons blankIcon]]);
- 				selector: (method isInstalled ifTrue: [#browseMethod:] ifFalse: [#browseMethodVersion:]);
- 				arguments: {method}]].
- 				
- 	latestClassChanges := (Array streamContents: [:s |
- 		ChangeSet current changedClassesDo: [:class :changeTypes :dateAndTime :category |
- 			"We are not interested in classes whose method's did only change."
- 			changeTypes ifNotEmpty: [s nextPut: { dateAndTime. class. changeTypes. category }]]])
- 			sorted: [:a :b | a first >= b first].
- 
- 	latestClassChanges ifNotEmpty: [menu addLine].
- 	1 to: (10 min: latestClassChanges size) do: [:index | | spec class |
- 		spec := latestClassChanges at: index.
- 		class := spec second.
- 		menu addItem: [:item |
- 			item
- 				contents: ('{1} \{{2}\}' format: {class name. spec fourth }) ;
- 				target: ToolSet;
- 				balloonText: (spec third sorted joinSeparatedBy: Character space);
- 				icon: ((spec third includesAnyOf: #(remove addedThenRemoved))
- 					ifTrue: [MenuIcons smallDeleteIcon]
- 					ifFalse: [
- 						(spec third includes: #add)
- 							ifTrue: [MenuIcons smallNewIcon]
- 							ifFalse: [MenuIcons blankIcon]]);
- 				selector: ((spec third includes: #remove) ifTrue: [#inspect:] ifFalse: [#browseClass:]);
- 				arguments: {class}]].
  	
+ 	Project current addDeferredUIMessage: [
+ 		menu lastItem delete.
+ 		
+ 		1 to: (10 min: latestMethodChanges size) do: [:index | | spec method |
+ 			spec := latestMethodChanges at: index.
+ 			method := spec second.
+ 			menu addItem: [:item |
+ 				item
+ 					contents: ('{1} {2} \{{3}\} \{{4}\}' format: {method methodClass. method selector. spec fourth. method methodClass category}) ;
+ 					target: ToolSet;
+ 					balloonText: spec third asString;
+ 					icon: ((#(remove addedThenRemoved) includes: spec third) ifTrue: [MenuIcons smallDeleteIcon] ifFalse: [
+ 						spec third = #add ifTrue: [MenuIcons smallNewIcon] ifFalse: [MenuIcons blankIcon]]);
+ 					selector: (method isInstalled ifTrue: [#browseMethod:] ifFalse: [#browseMethodVersion:]);
+ 					arguments: {method}]].
+ 					
+ 		latestClassChanges := (Array streamContents: [:s |
+ 			ChangeSet current changedClassesDo: [:class :changeTypes :dateAndTime :category |
+ 				"We are not interested in classes whose method's did only change."
+ 				changeTypes ifNotEmpty: [s nextPut: { dateAndTime. class. changeTypes. category }]]])
+ 				sorted: [:a :b | a first >= b first].
- 	menu defaultTarget: self.
- 	menu addTranslatedList: #(
- 		-
- 		('Browse current change set'		browseChangeSet)
- 		('Browse changed methods'		browseChangedMethods)
- 		-
- 		('Simple Change Sorter'				browseChanges)
- 		('Dual Change Sorter'					browseChangesDual)).
  
+ 		latestClassChanges ifNotEmpty: [menu addLine].
+ 		1 to: (10 min: latestClassChanges size) do: [:index | | spec class |
+ 			spec := latestClassChanges at: index.
+ 			class := spec second.
+ 			menu addItem: [:item |
+ 				item
+ 					contents: ('{1} \{{2}\}' format: {class name. spec fourth }) ;
+ 					target: ToolSet;
+ 					balloonText: (spec third sorted joinSeparatedBy: Character space);
+ 					icon: ((spec third includesAnyOf: #(remove addedThenRemoved))
+ 						ifTrue: [MenuIcons smallDeleteIcon]
+ 						ifFalse: [
+ 							(spec third includes: #add)
+ 								ifTrue: [MenuIcons smallNewIcon]
+ 								ifFalse: [MenuIcons blankIcon]]);
+ 					selector: ((spec third includes: #remove) ifTrue: [#inspect:] ifFalse: [#browseClass:]);
+ 					arguments: {class}]]]] forkAt: Processor userBackgroundPriority.!
- 
- !

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listCommonRequestsOn: (in category 'submenu - do') -----
  listCommonRequestsOn: aMenu
  
  	| strings |
+ 	aMenu add: 'edit this list' translated target: Utilities action: #editCommonRequestStrings.
+ 	aMenu addLine.
+ 	
  	strings := Utilities commonRequestStrings contents.
- 
  	strings asString linesDo: [:aString |
  		aString = '-'
  			ifTrue: [aMenu addLine]
+ 			ifFalse: [aMenu add: (aString ifEmpty: [' ']) target: Utilities selector: #eval: argument: aString]].!
- 			ifFalse: [aMenu add: (aString ifEmpty: [' ']) target: Utilities selector: #eval: argument: aString]].
- 
- 	aMenu addLine.
- 	aMenu add: 'edit this list' translated target: Utilities action: #editCommonRequestStrings.!

Item was changed:
  ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu - windows') -----
  listWindowsOn: menu
  
  	| windows |
+ 	menu
+ 		add: 'Collapse all windows' translated target: Project current world selector: #collapseAllWindows;
+ 		add: 'Close all windows' translated target: self selector: #closeAllWindowsUnsafe;
+ 		addItem: [:item | item
+ 			contents: 'Close all windows without changes' translated;
+ 			target: self;
+ 			icon: MenuIcons smallBroomIcon;
+ 			selector: #closeAllWindows];
+ 		add: 'Close all windows but workspaces' translated 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 ] ] ].!
- 				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.!



More information about the Squeak-dev mailing list