dock: display num of open windows

This commit is contained in:
end-4
2025-06-07 21:57:57 +02:00
parent f5168bfcb6
commit 0d4877a77e
@@ -17,6 +17,10 @@ DockButton {
required property var appToplevel
property var appListRoot
property int lastFocused: -1
property real iconSize: 35
property real countDotWidth: 10
property real countDotHeight: 4
MouseArea {
id: mouseArea
anchors.fill: parent
@@ -37,8 +41,38 @@ DockButton {
lastFocused = (lastFocused + 1) % appToplevel.toplevels.length
appToplevel.toplevels[lastFocused].activate()
}
contentItem: IconImage {
id: iconImage
source: Quickshell.iconPath(AppSearch.guessIcon(appToplevel.appId), "image-missing")
contentItem: Item {
anchors.centerIn: parent
IconImage {
id: iconImage
anchors {
left: parent.left
right: parent.right
verticalCenter: parent.verticalCenter
}
source: Quickshell.iconPath(AppSearch.guessIcon(appToplevel.appId), "image-missing")
implicitSize: appButton.iconSize
}
RowLayout {
spacing: 3
anchors {
top: iconImage.bottom
topMargin: 2
horizontalCenter: parent.horizontalCenter
}
Repeater {
model: Math.min(appToplevel.toplevels.length, 3)
delegate: Rectangle {
required property int index
radius: Appearance.rounding.full
implicitWidth: (appToplevel.toplevels.length <= 3) ?
appButton.countDotWidth : appButton.countDotHeight // Circles when too many
implicitHeight: appButton.countDotHeight
color: Appearance.m3colors.m3primary
}
}
}
}
}