diff options
| author | Robin Seger <pixelkhaos@gmail.com> | 2026-03-15 07:34:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-15 17:34:52 +1100 |
| commit | 1508abd3e13fe30bd90bc11d80b52aa8d8d4596e (patch) | |
| tree | aea4c81ace0344dbda5515b3e0ad613a3dd37568 | |
| parent | dash: use currentIndex for width, restore binding (#1286) (diff) | |
| download | caelestia-shell-1508abd3e13fe30bd90bc11d80b52aa8d8d4596e.tar.gz caelestia-shell-1508abd3e13fe30bd90bc11d80b52aa8d8d4596e.tar.bz2 caelestia-shell-1508abd3e13fe30bd90bc11d80b52aa8d8d4596e.zip | |
workspaces: window icons limit (#1267)
* workspace window icons display limit
* serialization
| -rw-r--r-- | config/BarConfig.qml | 1 | ||||
| -rw-r--r-- | config/Config.qml | 1 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/SpecialWorkspaces.qml | 6 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspace.qml | 6 | ||||
| -rw-r--r-- | modules/controlcenter/taskbar/TaskbarPane.qml | 37 |
5 files changed, 49 insertions, 2 deletions
diff --git a/config/BarConfig.qml b/config/BarConfig.qml index 36a5f78..62d6b17 100644 --- a/config/BarConfig.qml +++ b/config/BarConfig.qml @@ -71,6 +71,7 @@ JsonObject { property bool occupiedBg: false property bool showWindows: true property bool showWindowsOnSpecialWorkspaces: showWindows + property int maxWindowIcons: 0 // 0 = unlimited property bool activeTrail: false property bool perMonitorWorkspaces: true property string label: " " // if empty, will show workspace name's first letter diff --git a/config/Config.qml b/config/Config.qml index d6f5d19..eaeafb7 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -209,6 +209,7 @@ Singleton { occupiedBg: bar.workspaces.occupiedBg, showWindows: bar.workspaces.showWindows, showWindowsOnSpecialWorkspaces: bar.workspaces.showWindowsOnSpecialWorkspaces, + maxWindowIcons: bar.workspaces.maxWindowIcons, activeTrail: bar.workspaces.activeTrail, perMonitorWorkspaces: bar.workspaces.perMonitorWorkspaces, label: bar.workspaces.label, diff --git a/modules/bar/components/workspaces/SpecialWorkspaces.qml b/modules/bar/components/workspaces/SpecialWorkspaces.qml index ad85af8..cd3572b 100644 --- a/modules/bar/components/workspaces/SpecialWorkspaces.qml +++ b/modules/bar/components/workspaces/SpecialWorkspaces.qml @@ -224,7 +224,11 @@ Item { Repeater { model: ScriptModel { - values: Hypr.toplevels.values.filter(c => c.workspace?.id === ws.wsId) + values: { + const windows = Hypr.toplevels.values.filter(c => c.workspace?.id === ws.wsId); + const maxIcons = Config.bar.workspaces.maxWindowIcons; + return maxIcons > 0 ? windows.slice(0, maxIcons) : windows; + } } MaterialIcon { diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml index 3c8238b..f6e767e 100644 --- a/modules/bar/components/workspaces/Workspace.qml +++ b/modules/bar/components/workspaces/Workspace.qml @@ -87,7 +87,11 @@ ColumnLayout { Repeater { model: ScriptModel { - values: Hypr.toplevels.values.filter(c => c.workspace?.id === root.ws) + values: { + const windows = Hypr.toplevels.values.filter(c => c.workspace?.id === root.ws); + const maxIcons = Config.bar.workspaces.maxWindowIcons; + return maxIcons > 0 ? windows.slice(0, maxIcons) : windows; + } } MaterialIcon { diff --git a/modules/controlcenter/taskbar/TaskbarPane.qml b/modules/controlcenter/taskbar/TaskbarPane.qml index d12d174..9c999e5 100644 --- a/modules/controlcenter/taskbar/TaskbarPane.qml +++ b/modules/controlcenter/taskbar/TaskbarPane.qml @@ -38,6 +38,7 @@ Item { property bool workspacesActiveIndicator: Config.bar.workspaces.activeIndicator ?? true property bool workspacesOccupiedBg: Config.bar.workspaces.occupiedBg ?? false property bool workspacesShowWindows: Config.bar.workspaces.showWindows ?? false + property int workspacesMaxWindowIcons: Config.bar.workspaces.maxWindowIcons ?? 0 property bool workspacesPerMonitor: Config.bar.workspaces.perMonitorWorkspaces ?? true property bool scrollWorkspaces: Config.bar.scrollActions.workspaces ?? true property bool scrollVolume: Config.bar.scrollActions.volume ?? true @@ -81,6 +82,7 @@ Item { Config.bar.workspaces.activeIndicator = root.workspacesActiveIndicator; Config.bar.workspaces.occupiedBg = root.workspacesOccupiedBg; Config.bar.workspaces.showWindows = root.workspacesShowWindows; + Config.bar.workspaces.maxWindowIcons = root.workspacesMaxWindowIcons; Config.bar.workspaces.perMonitorWorkspaces = root.workspacesPerMonitor; Config.bar.scrollActions.workspaces = root.scrollWorkspaces; Config.bar.scrollActions.volume = root.scrollVolume; @@ -404,6 +406,41 @@ Item { StyledRect { Layout.fillWidth: true + implicitHeight: workspacesMaxWindowIconsRow.implicitHeight + Appearance.padding.large * 2 + radius: Appearance.rounding.normal + color: Colours.layer(Colours.palette.m3surfaceContainer, 2) + + Behavior on implicitHeight { + Anim {} + } + + RowLayout { + id: workspacesMaxWindowIconsRow + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.margins: Appearance.padding.large + spacing: Appearance.spacing.normal + + StyledText { + Layout.fillWidth: true + text: qsTr("Max window icons") + } + + CustomSpinBox { + min: 0 + max: 20 + value: root.workspacesMaxWindowIcons + onValueModified: value => { + root.workspacesMaxWindowIcons = value; + root.saveConfig(); + } + } + } + } + + StyledRect { + Layout.fillWidth: true implicitHeight: workspacesPerMonitorRow.implicitHeight + Appearance.padding.large * 2 radius: Appearance.rounding.normal color: Colours.layer(Colours.palette.m3surfaceContainer, 2) |