Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions src/Morphic-Widgets-MissionControl/MissionControlMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ MissionControlMorph class >> ensureMissionControlInWorld: world [
world submorphs detect: [ :m | m isKindOf: self ] ifNone: [ self new activateInWorld: world ]
]

{ #category : 'activation' }
MissionControlMorph class >> ensureMissionControlInWorldWithSameTabs: world [

world submorphs detect: [ :m | m isKindOf: self ] ifNone: [ self new activateOnlySameTypeInWorld: world ]
]

{ #category : 'world menu' }
MissionControlMorph class >> worldMenuEntryOn: aBuilder [

Expand All @@ -28,24 +34,37 @@ MissionControlMorph class >> worldMenuEntryOn: aBuilder [
]

{ #category : 'activation' }
MissionControlMorph >> activateInWorld: world [

| nonCollapsed collapsed |

nonCollapsed := world systemWindows reject: #isCollapsed.
collapsed := world systemWindows select: #isCollapsed.
MissionControlMorph >> activateIn: world tabs: tabs [

self bounds: world bounds.
spacesBar := MissionControlSpacesBar new initializeForWorld: world collapsedWindows: collapsed.

spacesBar := MissionControlSpacesBar new initializeForWorld: world collapsedWindows: {}.

self addMorph: spacesBar.
world addMorphFront: self.
self createThumbnailsFor: nonCollapsed.
self createThumbnailsFor: tabs.

world activeHand newKeyboardFocus: self.
isActive := true
]

{ #category : 'activation' }
MissionControlMorph >> activateInWorld: world [

self activateIn: world tabs: (world systemWindows reject: #isCollapsed)
]

{ #category : 'activation' }
MissionControlMorph >> activateOnlySameTypeInWorld: world [

| nonCollapsed |
nonCollapsed := world systemWindows select: [ :tab |
tab viewType = SystemWindow topWindow viewType
].

self activateIn: world tabs: nonCollapsed
]

{ #category : 'private' }
MissionControlMorph >> createThumbnailsFor: windows [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,28 @@ MissionControlShortcutsCategory class >> isGlobalCategory [
^ true
]

{ #category : 'keymaps' }
MissionControlShortcutsCategory >> isAlreadyOpen: world [

^ world submorphs anySatisfy: [ :m | m isKindOf: MissionControlMorph ]
]

{ #category : 'keymaps' }
MissionControlShortcutsCategory >> missionControlDismiss [

<shortcut>
^ KMKeymap shortcut: Character arrowDown meta action: [ WorldMorph allInstances first dismissMissionControl ]
^ KMKeymap shortcut: Character arrowDown meta action: [ :target :morph :event | | world |
world := WorldMorph allInstances first.
(self isAlreadyOpen: world) ifTrue: [ world dismissMissionControl ]
ifFalse: [ world missionControlWithSameType ]
]
]

{ #category : 'keymaps' }
MissionControlShortcutsCategory >> missionControlToggle [

<shortcut>
^ KMKeymap shortcut: Character arrowUp meta action: [ WorldMorph allInstances first missionControl ]
^ KMKeymap shortcut: Character arrowUp meta action: [
WorldMorph allInstances first missionControl
]
]
9 changes: 9 additions & 0 deletions src/Morphic-Widgets-MissionControl/WorldMorph.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,14 @@ WorldMorph >> dismissMissionControl [
WorldMorph >> missionControl [

"Toggle Mission Control"

MissionControlMorph ensureMissionControlInWorld: self
]

{ #category : '*Morphic-Widgets-MissionControl' }
WorldMorph >> missionControlWithSameType [

"Toggle Mission Control with the same type of tabs"

MissionControlMorph ensureMissionControlInWorldWithSameTabs: self
]
6 changes: 6 additions & 0 deletions src/Morphic-Widgets-Windows/SystemWindow.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3163,6 +3163,12 @@ SystemWindow >> useHideForClose [
^ self class useHideForClose
]

{ #category : 'accessing' }
SystemWindow >> viewType [

^ model class
]

{ #category : 'resize/collapse' }
SystemWindow >> wantsExpandBox [
"Answer whether I'd like an expand box"
Expand Down