extract HoverableListItem component from list delegates

This commit is contained in:
Damocles 2026-04-23 23:36:03 +02:00
parent 85e32dcd8c
commit e712842424
5 changed files with 29 additions and 47 deletions

View file

@ -121,22 +121,13 @@ Column {
Repeater {
model: root.sinkList
delegate: Item {
delegate: HoverableListItem {
required property var modelData
width: root.width
height: 28
readonly property bool _active: modelData === root.sink
Rectangle {
anchors.fill: parent
anchors.leftMargin: 4
anchors.rightMargin: 4
color: deviceHover.hovered ? S.Theme.base02 : "transparent"
radius: S.Theme.radius
}
Text {
anchors.left: parent.left
anchors.leftMargin: 12
@ -151,11 +142,6 @@ Column {
elide: Text.ElideRight
}
HoverHandler {
id: deviceHover
cursorShape: Qt.PointingHandCursor
}
TapHandler {
onTapped: Pipewire.preferredDefaultAudioSink = modelData
}