From e2a5eef008386c8c80f66a08ce896514d8c1dad6 Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Mon, 26 Jan 2026 19:40:22 +0100 Subject: [PATCH] volume is cracked --- Modules/AudioPopup.qml | 111 ++++++++++++++++++++++++++++++++++------- 1 file changed, 92 insertions(+), 19 deletions(-) diff --git a/Modules/AudioPopup.qml b/Modules/AudioPopup.qml index 5e315f5..02d32cc 100644 --- a/Modules/AudioPopup.qml +++ b/Modules/AudioPopup.qml @@ -76,22 +76,73 @@ Item { StackLayout { id: stack Layout.fillWidth: true + Layout.preferredHeight: currentIndex === 0 ? vol.childrenRect.height : dev.childrenRect.height currentIndex: 0 - VolumesTab {} - DevicesTab {} + VolumesTab { id: vol } + DevicesTab { id: dev } + + Behavior on currentIndex { + SequentialAnimation { + ParallelAnimation { + Anim { + target: stack + property: "opacity" + to: 0 + duration: MaterialEasing.expressiveEffectsTime + } + + Anim { + target: stack + property: "scale" + to: 0.9 + duration: MaterialEasing.expressiveEffectsTime + } + } + + PropertyAction {} + + ParallelAnimation { + Anim { + target: stack + property: "opacity" + to: 1 + duration: MaterialEasing.expressiveEffectsTime + } + + Anim { + target: stack + property: "scale" + to: 1 + duration: MaterialEasing.expressiveEffectsTime + } + } + } + } } } component VolumesTab: ColumnLayout { spacing: 12 - CustomText { - text: qsTr("Output Volume (%1)") - .arg(Audio.muted - ? qsTr("Muted") - : `${Math.round(Audio.volume * 100)}%`) - font.weight: 500 + RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true + + CustomText { + text: "Output Volume" + elide: Text.ElideRight + Layout.fillWidth: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + } + + CustomText { + text: qsTr("%1").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`); + font.bold: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + } } CustomMouseArea { @@ -107,13 +158,24 @@ Item { } } - CustomText { - Layout.topMargin: 10 - text: qsTr("Input Volume (%1)") - .arg(Audio.sourceMuted - ? qsTr("Muted") - : `${Math.round(Audio.sourceVolume * 100)}%`) - font.weight: 500 + RowLayout { + Layout.fillWidth: true + Layout.fillHeight: true + + CustomText { + text: "Input Volume" + elide: Text.ElideRight + Layout.fillWidth: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + } + + CustomText { + text: qsTr("%1").arg(Audio.sourceMuted ? qsTr("Muted") : `${Math.round(Audio.sourceVolume * 100)}%`); + font.bold: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + } } CustomMouseArea { @@ -188,12 +250,23 @@ Item { elideWidth: root.width - 50 } - CustomText { - text: metrics.elidedText - elide: Text.ElideRight + RowLayout { Layout.fillWidth: true Layout.fillHeight: true - Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + CustomText { + text: metrics.elidedText + elide: Text.ElideRight + Layout.fillWidth: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft + } + + CustomText { + text: qsTr("%1").arg(appBox.modelData.audio.muted ? qsTr("Muted") : `${Math.round(appBox.modelData.audio.volume * 100)}%`); + font.bold: true + Layout.fillHeight: true + Layout.alignment: Qt.AlignVCenter | Qt.AlignRight + } } CustomMouseArea {