nix/nixos/desktop/quickshell/ui/Pills.qml
Markus Zoppelt 6eef44005c feat: quickshell chrome and session helpers
Add Switch, Btn, and Menu. Share Session and Run.term. Widget skill for agents; no plugin host.
2026-08-29 13:46:57 +02:00

42 lines
1.1 KiB
QML

import QtQuick
import ".."
Row {
id: root
property var items: []
property string current: ""
signal picked(string id)
spacing: 8
width: parent ? parent.width : 360
Repeater {
model: root.items
Rectangle {
required property var modelData
width: (root.width - Math.max(root.items.length - 1, 0) * root.spacing) / Math.max(root.items.length, 1)
implicitHeight: 28
radius: 6
color: modelData.id === root.current ? Qt.alpha(Theme.blue, 0.25) : Theme.bgHighlight
border.width: 1
border.color: modelData.id === root.current ? Theme.blue : Theme.black
Text {
anchors.centerIn: parent
text: modelData.name
textFormat: Text.PlainText
color: Theme.fg
font.family: Theme.font
font.pixelSize: 13
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
root.picked(modelData.id);
}
}
}
}
}