From 03528a97e7df7c9bb464307670c366c6e5b329fe Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Fri, 3 Jul 2020 21:04:43 -0600 Subject: [PATCH] [OSD] Colorize percentage text when over 100% We've now made it easier to increase the maximum volume to 150% for those who need it due to quiet speakers. However since this could potentially lead to excessive volume or damage to loud speakers with long-term use, let's colorize the text to subtly indicate that this is not a normal state. --- lookandfeel/contents/osd/OsdItem.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lookandfeel/contents/osd/OsdItem.qml b/lookandfeel/contents/osd/OsdItem.qml index 5062c4be6..9de77cdc7 100644 --- a/lookandfeel/contents/osd/OsdItem.qml +++ b/lookandfeel/contents/osd/OsdItem.qml @@ -70,6 +70,20 @@ RowLayout { verticalAlignment: Text.AlignVCenter text: i18nc("Percentage value", "%1%", progressBar.value) visible: rootItem.showingProgress + // Display a subtle visual indication that the volume might be + // dangerously high + // ------------------------------------------------ + // Keep this in sync with the copies in plasma-pa:ListItemBase.qml + // and plasma-pa:VolumeSlider.qml + color: { + if (progressBar.value <= 100) { + return theme.textColor + } else if (progressBar.value > 100 && progressBar.value <= 125) { + return theme.neutralTextColor + } else { + return theme.negativeTextColor + } + } } PlasmaExtra.Heading {