From 66d1d3e9c35163693c0d2520e84b15b7632b073a Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 13 Jul 2025 01:54:30 +0700 Subject: [PATCH] volume mixer: adjust layout --- .../volumeMixer/VolumeMixerEntry.qml | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml index c4600c7b8..84cb572c8 100644 --- a/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml +++ b/.config/quickshell/ii/modules/sidebarRight/volumeMixer/VolumeMixerEntry.qml @@ -11,55 +11,56 @@ import Quickshell.Services.Pipewire Item { id: root - required property PwNode node; - PwObjectTracker { objects: [ node ] } + required property PwNode node + PwObjectTracker { + objects: [node] + } implicitHeight: rowLayout.implicitHeight RowLayout { id: rowLayout anchors.fill: parent - spacing: 10 + spacing: 6 + + Image { + property real size: slider.height * 0.9 + 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)) + return Quickshell.iconPath(icon, "image-missing"); + icon = AppSearch.guessIcon(root.node.properties["node.name"]); + return Quickshell.iconPath(icon, "image-missing"); + } + } ColumnLayout { Layout.fillWidth: true - spacing: 0 + spacing: -4 - RowLayout { - StyledText { - Layout.fillWidth: true - font.pixelSize: Appearance.font.pixelSize.normal - elide: Text.ElideRight - text: { - // application.name -> description -> name - const app = root.node.properties["application.name"] ?? (root.node.description != "" ? root.node.description : root.node.name); - const media = root.node.properties["media.name"]; - return media != undefined ? `${app} • ${media}` : app; - } + StyledText { + Layout.fillWidth: true + font.pixelSize: Appearance.font.pixelSize.small + color: Appearance.colors.colSubtext + elide: Text.ElideRight + text: { + // application.name -> description -> name + const app = root.node.properties["application.name"] ?? (root.node.description != "" ? root.node.description : root.node.name); + const media = root.node.properties["media.name"]; + return media != undefined ? `${app} • ${media}` : app; } } - RowLayout { - Image { - property real size: slider.trackHeight * 1.3 - 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)) return Quickshell.iconPath(icon, "image-missing"); - icon = AppSearch.guessIcon(root.node.properties["node.name"]); - return Quickshell.iconPath(icon, "image-missing"); - } - } - StyledSlider { - id: slider - value: root.node.audio.volume - onValueChanged: root.node.audio.volume = value - } + StyledSlider { + id: slider + value: root.node.audio.volume + onValueChanged: root.node.audio.volume = value } } } -} \ No newline at end of file +}