init
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Layouts 1.12
|
||||
|
||||
RowLayout {
|
||||
id: control
|
||||
property string label: ""
|
||||
property real from: 0
|
||||
property real to: 100
|
||||
property real stepSize: 1
|
||||
property real value: 0
|
||||
signal moved(real value)
|
||||
|
||||
Layout.fillWidth: true
|
||||
spacing: 10
|
||||
|
||||
Label {
|
||||
text: control.label
|
||||
color: settingsContainer.darkMode ? "white" : "black"
|
||||
Layout.preferredWidth: 150
|
||||
}
|
||||
Slider {
|
||||
id: slider
|
||||
Layout.fillWidth: true
|
||||
from: control.from
|
||||
to: control.to
|
||||
stepSize: control.stepSize
|
||||
value: control.value
|
||||
onMoved: control.moved(Math.round(value))
|
||||
}
|
||||
Label {
|
||||
text: Math.round(slider.value)
|
||||
color: settingsContainer.darkMode ? "white" : "black"
|
||||
Layout.preferredWidth: 36
|
||||
horizontalAlignment: Text.AlignRight
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user