Skip to content

Taskbar option to close windows hidden behind other windows #16552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
26 changes: 24 additions & 2 deletions src/Morphic-Widgets-Taskbar/SystemWindow.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ SystemWindow >> taskbarButtonMenu: aMenu [
getStateSelector: nil
enablementSelector: true.
submenu
addToggle: 'hidden windows' translated
target: self
selector: #taskbarCloseHiddenWindows
getStateSelector: nil
enablementSelector: true. submenu
addToggle: 'close all debuggers' translated
target: OupsDebuggerSystem
selector: #closeAllDebuggers
Expand All @@ -238,9 +243,9 @@ SystemWindow >> taskbarButtonMenu: aMenu [
{ #category : '*Morphic-Widgets-Taskbar' }
SystemWindow >> taskbarCloseAllLikeThis [

(self confirm: 'Do you really want to close all windows like this ?') ifFalse: [
(self confirm: 'Do you really want to close all windows like this?') ifFalse: [
^ self ].
(SystemWindow allSubInstances select: [ :w | w labelString = self labelString]) do: [ :w | w delete ]
(self class allSubInstances select: [ :w | w labelString = self labelString]) do: [ :w | w delete ]
]

{ #category : '*Morphic-Widgets-Taskbar' }
Expand Down Expand Up @@ -278,6 +283,23 @@ SystemWindow >> taskbarCloseAllWindows [
worldTaskbar tasks do: [ :task | task morph delete ] ]
]

{ #category : '*Morphic-Widgets-Taskbar' }
SystemWindow >> taskbarCloseHiddenWindows [

| windows invisible parts other |
(self confirm: 'Do you really want to close all windows hidden behind other windows?') ifFalse: [
^ self ].
windows := (self world submorphs select: [:each | each isSystemWindow ]) reversed.
invisible := windows withIndexSelect: [ :win :index |
bounds := win fullBoundsInWorld.
parts := OrderedCollection new.
other := (windows copyFrom: index+1 to: windows size) collect: [:each | each fullBoundsInWorld] .
bounds allAreasOutsideList: other do: [ :each | parts add: each ].
parts isEmpty
].
invisible do: [ :each | each close ].
]

{ #category : '*Morphic-Widgets-Taskbar' }
SystemWindow >> taskbarLabel [
"Answer the label to use for a taskbar button for the receiver."
Expand Down