diff --git a/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/Osd.qml b/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/Osd.qml index 2288ec11..c0b6a490 100644 --- a/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/Osd.qml +++ b/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/Osd.qml @@ -37,6 +37,8 @@ PlasmaCore.Dialog { // Set to true if the value is meant for progress bar, // false for displaying the value as normal text property bool showingProgress: false + // Maximum value of progress bar (overriden for volume amplification) + property int osdMaxValue: 100 mainItem: OsdItem { rootItem: root diff --git a/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/OsdItem.qml b/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/OsdItem.qml index ea3c73a1..0c11ca38 100644 --- a/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/OsdItem.qml +++ b/kde/plasma/look-and-feel/Sweet-Mars/contents/osd/OsdItem.qml @@ -35,6 +35,8 @@ Item { // | | | | // | \----------------/ | // | spacing | + // | percentage | + // | spacing | // | [progressbar/text] | // | spacing | // \--------------------/ @@ -61,10 +63,30 @@ Item { visible: rootItem.showingProgress minimumValue: 0 - maximumValue: 100 + maximumValue: rootItem.osdMaxValue value: Number(rootItem.osdValue) + + PlasmaExtra.Heading { + anchors { + bottom: progressBar.top + bottomMargin: units.smallSpacing + horizontalCenter: parent.horizontalCenter + } + level: 4 + text: Math.round(progressBar.value) + "%" + color: { + if (progressBar.value <= 100) { + return theme.textColor + } else if (progressBar.value <= 125) { + return theme.neutralTextColor + } else { + return theme.negativeTextColor + } + } + } } + PlasmaExtra.Heading { id: label anchors { @@ -73,7 +95,6 @@ Item { right: parent.right margins: Math.floor(units.smallSpacing / 2) } - visible: !rootItem.showingProgress text: rootItem.showingProgress ? "" : (rootItem.osdValue ? rootItem.osdValue : "") horizontalAlignment: Text.AlignHCenter