1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Add option to only show apps in the current workspace in the running apps widget

niri only currently - but should be simple enough to add support for
others
This commit is contained in:
Gonen Gazit
2025-08-26 21:53:54 +03:00
parent 6e75e2b06c
commit baea0ecc92
5 changed files with 98 additions and 7 deletions

View File

@@ -232,6 +232,56 @@ Item {
}
}
StyledRect {
width: parent.width
height: runningAppsSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
id: runningAppsSection
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "apps"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "Running Apps Settings"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
width: parent.width
text: "Running Apps Only In Current Workspace"
description: "Show only apps running in current workspace (currently niri only)"
checked: SettingsData.runningAppsCurrentWorkspace
onToggled: checked => {
return SettingsData.setRunningAppsCurrentWorkspace(
checked)
}
}
}
}
StyledRect {
width: parent.width
height: workspaceIconsSection.implicitHeight + Theme.spacingL * 2

View File

@@ -18,7 +18,12 @@ Rectangle {
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 2 : Theme.spacingS
// The visual root for this window
property Item windowRoot: (Window.window ? Window.window.contentItem : null)
readonly property var sortedToplevels: CompositorService.sortedToplevels
readonly property var sortedToplevels: {
if (SettingsData.runningAppsCurrentWorkspace){
return CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, parentScreen.name)
}
return CompositorService.sortedToplevels
}
readonly property int windowCount: sortedToplevels.length
readonly property int calculatedWidth: {
if (windowCount === 0)