From 2ad51bb67dffbec397faa12c636c373b7f540ef4 Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Fri, 7 Nov 2025 19:47:49 +0100 Subject: [PATCH] OSD: add proper handling for volume overdrive --- Modules/OSD/OSD.qml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index 64549d45..0cc39773 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -73,17 +73,29 @@ Variants { return 0 } + // Get maximum value for current OSD type + function getMaxValue() { + if (currentOSDType === "volume" || currentOSDType === "inputVolume") { + return Settings.data.audio.volumeOverdrive ? 1.5 : 1.0 + } else if (currentOSDType === "brightness") { + return 1.0 + } + return 1.0 + } + // Get display percentage function getDisplayPercentage() { if (currentOSDType === "volume") { if (isMuted) return "0%" - const pct = Math.round(Math.min(1.0, currentVolume) * 100) + const max = getMaxValue() + const pct = Math.round(Math.min(max, currentVolume) * 100) return pct + "%" } else if (currentOSDType === "inputVolume") { if (isInputMuted) return "0%" - const pct = Math.round(Math.min(1.0, currentInputVolume) * 100) + const max = getMaxValue() + const pct = Math.round(Math.min(max, currentInputVolume) * 100) return pct + "%" } else if (currentOSDType === "brightness") { const pct = Math.round(Math.min(1.0, currentBrightness) * 100) @@ -304,7 +316,7 @@ Variants { anchors.left: parent.left anchors.top: parent.top anchors.bottom: parent.bottom - width: parent.width * Math.min(1.0, root.getCurrentValue()) + width: parent.width * Math.min(1.0, root.getCurrentValue() / root.getMaxValue()) radius: parent.radius color: root.getProgressColor() @@ -393,7 +405,7 @@ Variants { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom - height: parent.height * Math.min(1.0, root.getCurrentValue()) + height: parent.height * Math.min(1.0, root.getCurrentValue() / root.getMaxValue()) radius: parent.radius color: root.getProgressColor()