mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Improve layer slider label positions - CURA-4412
This commit is contained in:
parent
84ec494023
commit
52eac6635f
2 changed files with 9 additions and 11 deletions
|
@ -185,10 +185,9 @@ Item {
|
||||||
id: upperHandleLabel
|
id: upperHandleLabel
|
||||||
|
|
||||||
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
|
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
|
||||||
// width is calculated automatically from the input field width
|
x: parent.x - width - UM.Theme.getSize("default_margin").width
|
||||||
x: parent.x - width // align with slider handle
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
y: parent.anchors.top - height // align with slider? handle
|
target: Qt.point(sliderRoot.width, y + height / 2)
|
||||||
target: Qt.point(sliderRoot.width, parent.y + parent.height / 2)
|
|
||||||
visible: sliderRoot.layersVisible
|
visible: sliderRoot.layersVisible
|
||||||
|
|
||||||
// custom properties
|
// custom properties
|
||||||
|
@ -265,10 +264,9 @@ Item {
|
||||||
id: lowerHandleLabel
|
id: lowerHandleLabel
|
||||||
|
|
||||||
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
|
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
|
||||||
// width is calculated automatically from the input field width
|
x: parent.x - width - UM.Theme.getSize("default_margin").width
|
||||||
x: (parent.x + (parent.width / 2)) - width - 100
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
y: Math.floor(parent.y + height / 2)
|
target: Qt.point(sliderRoot.width, y + height / 2)
|
||||||
target: Qt.point(sliderRoot.width, parent.y + parent.height / 2)
|
|
||||||
visible: sliderRoot.layersVisible
|
visible: sliderRoot.layersVisible
|
||||||
|
|
||||||
// custom properties
|
// custom properties
|
||||||
|
|
|
@ -13,13 +13,12 @@ UM.PointingRectangle {
|
||||||
id: sliderLabelRoot
|
id: sliderLabelRoot
|
||||||
|
|
||||||
// custom properties
|
// custom properties
|
||||||
property var target // Qt.point
|
|
||||||
property real maximumValue: 100
|
property real maximumValue: 100
|
||||||
property real value: 0
|
property real value: 0
|
||||||
property var setValue // Function
|
property var setValue // Function
|
||||||
property bool busy: false
|
property bool busy: false
|
||||||
|
|
||||||
target: sliderLabelRoot.target
|
target: Qt.point(parent.width, y + height / 2)
|
||||||
arrowSize: UM.Theme.getSize("default_arrow").width
|
arrowSize: UM.Theme.getSize("default_arrow").width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: valueLabel.width + UM.Theme.getSize("default_margin").width
|
width: valueLabel.width + UM.Theme.getSize("default_margin").width
|
||||||
|
@ -50,7 +49,8 @@ UM.PointingRectangle {
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
width: Math.max(UM.Theme.getSize("line").width * sliderLabelRoot.maximumValue.length + 2 * screenScaleFactor, 20 * screenScaleFactor)
|
// width is based on text field contents, but never smaller than 20pts
|
||||||
|
width: 40 * screenScaleFactor
|
||||||
|
|
||||||
text: sliderLabelRoot.value + 1 // the current handle value, add 1 because layers is an array
|
text: sliderLabelRoot.value + 1 // the current handle value, add 1 because layers is an array
|
||||||
horizontalAlignment: TextInput.AlignRight
|
horizontalAlignment: TextInput.AlignRight
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue