mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 14:59:27 -05:00
change mousearea to correct item and add tooltip
This commit is contained in:
+11
-4
@@ -7,10 +7,8 @@ import Quickshell
|
||||
import Quickshell.Services.Pipewire
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
MouseArea {
|
||||
Item {
|
||||
id: root
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: root.node.audio.muted = !root.node.audio.muted
|
||||
required property PwNode node
|
||||
PwObjectTracker {
|
||||
objects: [root.node]
|
||||
@@ -23,12 +21,21 @@ MouseArea {
|
||||
anchors.fill: parent
|
||||
spacing: 6
|
||||
|
||||
Item {
|
||||
MouseArea {
|
||||
property real size: 36
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
Layout.preferredWidth: 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 {
|
||||
id: iconImg
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in New Issue
Block a user