]> Some of my projects - aniplayer.git/commitdiff
Volume slider updates
authorAPTX <marek321@gmail.com>
Mon, 21 Feb 2022 13:45:45 +0000 (22:45 +0900)
committerAPTX <marek321@gmail.com>
Mon, 21 Feb 2022 13:45:45 +0000 (22:45 +0900)
Show volume percentage.
Draw slider in orange when volume is over 100%.

uiplugins/ui_desktop_qml_default/qml/VolumeSlider.qml

index 5e68d5f819caa02766e329d8b36ca36b40e8ef24..571f1515aabf1ecbf96b7aa698057a901228d2ad 100644 (file)
@@ -8,7 +8,7 @@ Item {
 
     Rectangle {
         id: heard
-        color: "#00B000"
+        color: volume <= 1.0 ? "#00B000" : "orange"
         anchors.left: parent.left
         anchors.top: parent.top
         anchors.bottom: parent.bottom
@@ -26,6 +26,12 @@ Item {
         anchors.bottom: parent.bottom
     }
 
+    Text {
+        id: currentVolumeText
+        anchors.centerIn: parent
+        text: Math.round(volume * 100) + "%"
+    }
+
     MouseArea {
         id: ma
         anchors.fill: parent