replace MouseArea with TapHandler in panel content, fix chevron double-fire with idempotent expand

This commit is contained in:
Damocles 2026-04-13 21:49:43 +02:00
parent 5eb6ce6d96
commit cce695a8c6
2 changed files with 25 additions and 28 deletions

View file

@ -132,10 +132,9 @@ M.BarSection {
font.pixelSize: M.Theme.fontSize + 2
font.family: M.Theme.iconFontFamily
MouseArea {
anchors.fill: parent
TapHandler {
cursorShape: Qt.PointingHandCursor
onClicked: if (root.sink?.audio)
onTapped: if (root.sink?.audio)
root.sink.audio.muted = !root.sink.audio.muted
}
}
@ -230,7 +229,7 @@ M.BarSection {
TapHandler {
cursorShape: Qt.PointingHandCursor
onTapped: root._expanded = !root._expanded
onTapped: root._expanded = true
}
}
@ -285,7 +284,7 @@ M.BarSection {
anchors.fill: parent
anchors.leftMargin: 4
anchors.rightMargin: 4
color: deviceArea.containsMouse ? M.Theme.base02 : "transparent"
color: deviceHover.hovered ? M.Theme.base02 : "transparent"
radius: M.Theme.radius
}
@ -303,12 +302,13 @@ M.BarSection {
elide: Text.ElideRight
}
MouseArea {
id: deviceArea
anchors.fill: parent
hoverEnabled: true
HoverHandler {
id: deviceHover
cursorShape: Qt.PointingHandCursor
onClicked: Pipewire.preferredDefaultAudioSink = modelData
}
TapHandler {
onTapped: Pipewire.preferredDefaultAudioSink = modelData
}
}
}
@ -365,10 +365,9 @@ M.BarSection {
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.iconFontFamily
MouseArea {
anchors.fill: parent
TapHandler {
cursorShape: Qt.PointingHandCursor
onClicked: if (streamEntry.modelData.audio)
onTapped: if (streamEntry.modelData.audio)
streamEntry.modelData.audio.muted = !streamEntry.modelData.audio.muted
}
}