extract HoverableListItem component from list delegates
This commit is contained in:
parent
85e32dcd8c
commit
e712842424
5 changed files with 29 additions and 47 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue