mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 20:45:55 +08:00
Make the slider label width adjustable depending on the number of digits of
the total number of layers.
This commit is contained in:
parent
c31d329657
commit
7cd0f57f22
@ -53,7 +53,7 @@ UM.PointingRectangle {
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
width: 40 * screenScaleFactor
|
||||
width: maximumValue.toString().length * 10 * screenScaleFactor
|
||||
text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array
|
||||
horizontalAlignment: TextInput.AlignRight
|
||||
|
||||
@ -77,11 +77,12 @@ UM.PointingRectangle {
|
||||
if (valueLabel.text != "") {
|
||||
// -startFrom because we need to convert back to an array structure
|
||||
sliderLabelRoot.setValue(parseInt(valueLabel.text) - startFrom)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
validator: IntValidator {
|
||||
bottom:startFrom
|
||||
bottom: startFrom
|
||||
top: sliderLabelRoot.maximumValue + startFrom // +startFrom because maybe we want to start in a different value rather than 0
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user