change mousearea to correct item and add tooltip

This commit is contained in:
end-4
2026-03-23 08:21:18 +01:00
parent 15a56bdce3
commit 854016e82a
@@ -7,10 +7,8 @@ import Quickshell
import Quickshell.Services.Pipewire import Quickshell.Services.Pipewire
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
MouseArea { Item {
id: root id: root
cursorShape: Qt.PointingHandCursor
onClicked: root.node.audio.muted = !root.node.audio.muted
required property PwNode node required property PwNode node
PwObjectTracker { PwObjectTracker {
objects: [root.node] objects: [root.node]
@@ -23,12 +21,21 @@ MouseArea {
anchors.fill: parent anchors.fill: parent
spacing: 6 spacing: 6
Item { MouseArea {
property real size: 36 property real size: 36
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.preferredWidth: size Layout.preferredWidth: size
Layout.preferredHeight: size Layout.preferredHeight: size
cursorShape: Qt.PointingHandCursor
onClicked: root.node.audio.muted = !root.node.audio.muted
hoverEnabled: true
property bool hovered: containsMouse
StyledToolTip {
text: root.node?.audio.muted ? Translation.tr("Click to unmute") : Translation.tr("Click to mute")
}
Image { Image {
id: iconImg id: iconImg
anchors.fill: parent anchors.fill: parent