Alexander Lazarević uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-laza.370.mcz ==================== Summary ==================== Name: Morphic-laza.370 Author: laza Time: 3 March 2010, 5:50:21.943 am UUID: 395d8f91-3f11-0840-9692-79f811ebbd4b Ancestors: Morphic-ar.369 Add to the windows menu: - contain every visible window (collapsed or not) - show a collapsed window in the list by putting () around the label - show a touched window by putting a leading * to the label - group windows by model (eg. Browsers are most likely always at the top of the list) - have a "close all like this" menu entry to close all windows of a same kind (eg. close all open inspectors) [won't touch any windows with changed content] - have a "close all but this" menu entry which does exactly like the above, but without closing the selected window =============== Diff against Morphic-ar.369 =============== Item was added: + ----- Method: TheWorldMainDockingBar>>allOtherWindowsLike: (in category 'submenu - windows') ----- + allOtherWindowsLike: window + ^ self allVisibleWindows reject: [:each | + each model name ~= window model name or: [each = window]]! Item was added: + ----- Method: TheWorldMainDockingBar>>allVisibleWindows (in category 'submenu - windows') ----- + allVisibleWindows + ^SystemWindow windowsIn: World satisfying: [ :w | w visible ]! Item was added: + ----- Method: TheWorldMainDockingBar>>closeAllWindowsLike: (in category 'submenu - windows') ----- + closeAllWindowsLike: window + self closeAllWindowsBut: window. + window model canDiscardEdits ifTrue: [window delete]! Item was changed: ----- Method: TheWorldMainDockingBar>>windowMenuFor:on: (in category 'submenu - windows') ----- windowMenuFor: window on: menu menu addItem: [ :item | item contents: 'Close'; target: window; selector: #delete ]; addItem: [ :item | + item + contents: 'Close all like this'; + target: self; + selector: #closeAllWindowsLike:; + arguments: { window } ]; + addItem: [ :item | + item + contents: 'Close all but this'; + target: self; + selector: #closeAllWindowsBut:; + arguments: { window } ]; + addItem: [ :item | item contents: 'Toggle Full Screen'; target: window; selector: #expandBoxHit ]! Item was added: + ----- Method: TheWorldMainDockingBar>>allWindowsLike: (in category 'submenu - windows') ----- + allWindowsLike: window + ^ self allVisibleWindows reject: [:each | each model ~= window model or: [each = window]]! Item was changed: ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu - windows') ----- listWindowsOn: menu + | windows | + windows := SortedCollection sortBlock: [:winA :winB | + winA model name = winB model name + ifTrue: [winA label < winB label] + ifFalse: [winA model name < winB model name]]. + windows addAll: self allVisibleWindows. + windows ifEmpty: [ - | expanded | - expanded := SystemWindow windowsIn: World satisfying: [ :w | w isCollapsed not ]. - expanded ifEmpty: [ menu addItem: [ :item | item + contents: 'No Windows' translated; - contents: 'No open Windows' translated; isEnabled: false ] ]. + windows do: [ :each | - expanded do: [ :each | menu addItem: [ :item | item + contents: (self windowMenuItemLabelFor: each); - contents: (each label contractTo: 50); icon: (self colorIcon: each paneColor); target: each; selector: #comeToFront; subMenuUpdater: self selector: #windowMenuFor:on: arguments: { each }; + action: [ each activateAndForceLabelToShow; expand ] ] ].! - action: [ each activateAndForceLabelToShow ] ] ].! Item was added: + ----- Method: TheWorldMainDockingBar>>windowMenuItemLabelFor: (in category 'submenu - windows') ----- + windowMenuItemLabelFor: window + | s | + s := WriteStream on: String new. + window model canDiscardEdits ifFalse: [ s nextPut: $* ]. + window isCollapsed ifTrue: [ s nextPut: $( ]. + s nextPutAll: window label. + window isCollapsed ifTrue: [ s nextPut: $) ]. + ^s contents contractTo: 50! Item was added: + ----- Method: TheWorldMainDockingBar>>closeAllWindowsBut: (in category 'submenu - windows') ----- + closeAllWindowsBut: window + (self allOtherWindowsLike: window) do: [:each | + each model canDiscardEdits ifTrue: [each delete]]! |
Free forum by Nabble | Edit this page |