diff options
author | Loïc Collignon <loic.collignon@iot.bzh> | 2018-07-05 14:30:25 +0200 |
---|---|---|
committer | Loïc Collignon <loic.collignon@iot.bzh> | 2018-07-10 19:21:41 +0200 |
commit | d009b2e3665ab49ce8885a7d1f59d67bdaf4cd7e (patch) | |
tree | 38337c044e2c50989ffc98cc7c5d2b9598f36eca /app/VolumeSlider.qml | |
parent | 9b2c0778e6b83591cbad1d9c76cbcad2186512d9 (diff) |
WIP better handling for slider creation
The creation of sliders is now using a template instead of a string
computation.
Also fixed some indentation and trailing spaces issues.
Change-Id: Ieb1d9f953d61fa1bac46bf1ab6904e67d09a3fa9
Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'app/VolumeSlider.qml')
-rw-r--r-- | app/VolumeSlider.qml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/app/VolumeSlider.qml b/app/VolumeSlider.qml new file mode 100644 index 0000000..56881b7 --- /dev/null +++ b/app/VolumeSlider.qml @@ -0,0 +1,44 @@ +import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 + +RowLayout { + property int value + property string role + + onRoleChanged: sliderName.text = role + onValueChanged: { + sliderValue.text = value + " %" + sliderControl.value = value; + } + + //id: slider_" + name + " + Layout.minimumHeight: 75 + Label { + id: sliderName + font.pixelSize: 24 + text: role + Layout.minimumWidth: 150 + } + Label { + id: sliderValue + //id: slider_" + name + "_textvalue + font.pixelSize: 24 + text: "0 %" + } + Slider { + id: sliderControl + //id: slider_" + name + "_slider + Layout.fillWidth: true + from: 0 + to: 100 + stepSize: 1 + snapMode: Slider.SnapOnRelease + onValueChanged: { + //slider_" + name + "_textvalue.text = value + \" %\" + //mixer.setVolume(\"" + name + "\", value) + } + //Component.onCompleted: { + //mixer.getVolume(\"" + name + "\") + //} + } +} |