forked from Shinonome/dots-hyprland
dock: display num of open windows
This commit is contained in:
@@ -17,6 +17,10 @@ DockButton {
|
|||||||
required property var appToplevel
|
required property var appToplevel
|
||||||
property var appListRoot
|
property var appListRoot
|
||||||
property int lastFocused: -1
|
property int lastFocused: -1
|
||||||
|
property real iconSize: 35
|
||||||
|
property real countDotWidth: 10
|
||||||
|
property real countDotHeight: 4
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseArea
|
id: mouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -37,8 +41,38 @@ DockButton {
|
|||||||
lastFocused = (lastFocused + 1) % appToplevel.toplevels.length
|
lastFocused = (lastFocused + 1) % appToplevel.toplevels.length
|
||||||
appToplevel.toplevels[lastFocused].activate()
|
appToplevel.toplevels[lastFocused].activate()
|
||||||
}
|
}
|
||||||
contentItem: IconImage {
|
contentItem: Item {
|
||||||
id: iconImage
|
anchors.centerIn: parent
|
||||||
source: Quickshell.iconPath(AppSearch.guessIcon(appToplevel.appId), "image-missing")
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user