From a7449ade87227584e8b848f0621e5982c7559cbe Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 19 Jul 2018 11:42:42 +0200 Subject: [PATCH 1/2] When the number of layers is less than 10, the width of the TextField that shows the layer number in the LayerView is too small, so this commit adjusts the size. --- plugins/SimulationView/SimulationSliderLabel.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SimulationView/SimulationSliderLabel.qml b/plugins/SimulationView/SimulationSliderLabel.qml index 8615a382da..cdefd75f2b 100644 --- a/plugins/SimulationView/SimulationSliderLabel.qml +++ b/plugins/SimulationView/SimulationSliderLabel.qml @@ -53,7 +53,7 @@ UM.PointingRectangle { verticalCenter: parent.verticalCenter } - width: maximumValue.toString().length * 12 * screenScaleFactor + width: (maximumValue.toString().length + 1) * 8 * screenScaleFactor text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array horizontalAlignment: TextInput.AlignRight From cfcf52d7c3a53f92daa4b39501ba9badafbaec6e Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 5 Sep 2018 22:05:08 +0200 Subject: [PATCH 2/2] Center in parent and increase width. Fits good on Mac --- plugins/SimulationView/SimulationSliderLabel.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/SimulationView/SimulationSliderLabel.qml b/plugins/SimulationView/SimulationSliderLabel.qml index 559bffadc4..b69fede243 100644 --- a/plugins/SimulationView/SimulationSliderLabel.qml +++ b/plugins/SimulationView/SimulationSliderLabel.qml @@ -44,12 +44,11 @@ UM.PointingRectangle { id: valueLabel anchors { - left: parent.left - leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2) verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter } - width: (maximumValue.toString().length + 1) * 8 * screenScaleFactor + width: (maximumValue.toString().length + 1) * 10 * screenScaleFactor text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array horizontalAlignment: TextInput.AlignRight