From 369fadd74b59b1b6b2d9d8b6dbd7c995648632be Mon Sep 17 00:00:00 2001 From: Pico Date: Fri, 20 Mar 2026 09:00:33 +0300 Subject: [PATCH 1/3] add click-to-mute on app icons in the volume mixer --- .../volumeMixer/VolumeMixerEntry.qml | 53 +++++++++++++++---- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml index a871c05c6..f616273ed 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml @@ -5,6 +5,7 @@ import QtQuick import QtQuick.Layouts import Quickshell import Quickshell.Services.Pipewire +import Qt5Compat.GraphicalEffects Item { id: root @@ -20,19 +21,51 @@ Item { anchors.fill: parent spacing: 6 - Image { + Item { property real size: 36 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - visible: source != "" - sourceSize.width: size - sourceSize.height: size - source: { - let icon; - icon = AppSearch.guessIcon(root.node?.properties["application.icon-name"] ?? ""); - if (AppSearch.iconExists(icon)) + Layout.preferredWidth: size + Layout.preferredHeight: size + + Image { + id: iconImg + anchors.fill: parent + visible: false + sourceSize.width: parent.size + sourceSize.height: parent.size + source: { + let icon; + icon = AppSearch.guessIcon(root.node?.properties["application.icon-name"] ?? ""); + if (AppSearch.iconExists(icon)) + return Quickshell.iconPath(icon, "image-missing"); + icon = AppSearch.guessIcon(root.node?.properties["node.name"] ?? ""); return Quickshell.iconPath(icon, "image-missing"); - icon = AppSearch.guessIcon(root.node?.properties["node.name"] ?? ""); - return Quickshell.iconPath(icon, "image-missing"); + } + } + + Desaturate { + anchors.fill: iconImg + source: iconImg + desaturation: root.node?.audio.muted ? 1.0 : 0.0 + visible: iconImg.source != "" + opacity: root.node?.audio.muted ? 0.4 : 1.0 + + Behavior on opacity { NumberAnimation { duration: 150 } } + Behavior on desaturation { NumberAnimation { duration: 150 } } + } + + MaterialSymbol { + anchors.centerIn: parent + visible: root.node?.audio.muted ?? false + text: root.node?.isSink ? "volume_off" : "mic_off" + font.pixelSize: 22 + color: Appearance.colors.colError + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: root.node.audio.muted = !root.node.audio.muted } } From 15a56bdce3070cc8b1a0d7e3bc51e4fe5436b899 Mon Sep 17 00:00:00 2001 From: Pico Date: Sun, 22 Mar 2026 10:40:07 +0300 Subject: [PATCH 2/3] use text color for mute icon and promote root to MouseArea --- .../volumeMixer/VolumeMixerEntry.qml | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml index f616273ed..5e4fec97b 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml @@ -7,8 +7,10 @@ import Quickshell import Quickshell.Services.Pipewire import Qt5Compat.GraphicalEffects -Item { +MouseArea { id: root + cursorShape: Qt.PointingHandCursor + onClicked: root.node.audio.muted = !root.node.audio.muted required property PwNode node PwObjectTracker { objects: [root.node] @@ -47,25 +49,27 @@ Item { anchors.fill: iconImg source: iconImg desaturation: root.node?.audio.muted ? 1.0 : 0.0 - visible: iconImg.source != "" + visible: iconImg.source !== "" opacity: root.node?.audio.muted ? 0.4 : 1.0 - - Behavior on opacity { NumberAnimation { duration: 150 } } - Behavior on desaturation { NumberAnimation { duration: 150 } } + + Behavior on opacity { + NumberAnimation { + duration: 150 + } + } + Behavior on desaturation { + NumberAnimation { + duration: 150 + } + } } MaterialSymbol { anchors.centerIn: parent visible: root.node?.audio.muted ?? false text: root.node?.isSink ? "volume_off" : "mic_off" - font.pixelSize: 22 - color: Appearance.colors.colError - } - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - onClicked: root.node.audio.muted = !root.node.audio.muted + iconSize: 22 + color: Appearance.colors.colOnLayer1 } } From 854016e82a93df4aa7f0db373c3d5544ec297491 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 23 Mar 2026 08:21:18 +0100 Subject: [PATCH 3/3] change mousearea to correct item and add tooltip --- .../sidebarRight/volumeMixer/VolumeMixerEntry.qml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml b/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml index 5e4fec97b..8598cd5cb 100644 --- a/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml +++ b/dots/.config/quickshell/ii/modules/ii/sidebarRight/volumeMixer/VolumeMixerEntry.qml @@ -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