forked from Shinonome/dots-hyprland
use text color for mute icon and promote root to MouseArea
This commit is contained in:
+17
-13
@@ -7,8 +7,10 @@ import Quickshell
|
|||||||
import Quickshell.Services.Pipewire
|
import Quickshell.Services.Pipewire
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
Item {
|
MouseArea {
|
||||||
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]
|
||||||
@@ -47,25 +49,27 @@ Item {
|
|||||||
anchors.fill: iconImg
|
anchors.fill: iconImg
|
||||||
source: iconImg
|
source: iconImg
|
||||||
desaturation: root.node?.audio.muted ? 1.0 : 0.0
|
desaturation: root.node?.audio.muted ? 1.0 : 0.0
|
||||||
visible: iconImg.source != ""
|
visible: iconImg.source !== ""
|
||||||
opacity: root.node?.audio.muted ? 0.4 : 1.0
|
opacity: root.node?.audio.muted ? 0.4 : 1.0
|
||||||
|
|
||||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
Behavior on opacity {
|
||||||
Behavior on desaturation { NumberAnimation { duration: 150 } }
|
NumberAnimation {
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Behavior on desaturation {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: root.node?.audio.muted ?? false
|
visible: root.node?.audio.muted ?? false
|
||||||
text: root.node?.isSink ? "volume_off" : "mic_off"
|
text: root.node?.isSink ? "volume_off" : "mic_off"
|
||||||
font.pixelSize: 22
|
iconSize: 22
|
||||||
color: Appearance.colors.colError
|
color: Appearance.colors.colOnLayer1
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: root.node.audio.muted = !root.node.audio.muted
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user