mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06: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
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue