HoverableListItem: add tapped signal, remove inline TapHandlers
This commit is contained in:
parent
e712842424
commit
732a14e5cb
4 changed files with 14 additions and 15 deletions
|
|
@ -72,11 +72,9 @@ Column {
|
||||||
entry.opacity = 1
|
entry.opacity = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
onTapped: {
|
||||||
onTapped: {
|
if (!entry._pending)
|
||||||
if (!entry._pending)
|
S.BluetoothService.toggleDevice(entry.modelData.mac, !entry.modelData.connected);
|
||||||
S.BluetoothService.toggleDevice(entry.modelData.mac, !entry.modelData.connected);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property bool hovered: _hover.hovered
|
readonly property bool hovered: _hover.hovered
|
||||||
|
signal tapped
|
||||||
|
|
||||||
width: parent?.width ?? 0
|
width: parent?.width ?? 0
|
||||||
height: 32
|
height: 32
|
||||||
|
|
@ -22,4 +23,8 @@ Item {
|
||||||
id: _hover
|
id: _hover
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
onTapped: root.tapped()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,11 @@ Column {
|
||||||
width: entry.modelData.signal >= 0 ? implicitWidth : 0
|
width: entry.modelData.signal >= 0 ? implicitWidth : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
onTapped: {
|
||||||
onTapped: {
|
if (entry.modelData.active)
|
||||||
if (entry.modelData.active)
|
S.NetworkService.disconnectNetwork(entry.modelData.uuid);
|
||||||
S.NetworkService.disconnectNetwork(entry.modelData.uuid);
|
else
|
||||||
else
|
S.NetworkService.connectNetwork(entry.modelData.uuid);
|
||||||
S.NetworkService.connectNetwork(entry.modelData.uuid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,9 +142,7 @@ Column {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
onTapped: Pipewire.preferredDefaultAudioSink = modelData
|
||||||
onTapped: Pipewire.preferredDefaultAudioSink = modelData
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue