[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.
wilder-portage-prov
Nate Graham 6 years ago
parent ade3bc4aa1
commit 03528a97e7
  1. 14
      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 {

Loading…
Cancel
Save