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 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
|
||||||
|
|||||||
Reference in New Issue
Block a user