workspaces: window icons limit (#1267)
* workspace window icons display limit * serialization
This commit is contained in:
parent
12b07b7cdf
commit
1508abd3e1
5 changed files with 49 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -402,6 +404,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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue