Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2021-11-11 18:51:03 +0300
committerJaime van Kessel <nallath@gmail.com>2021-11-11 18:51:03 +0300
commit75cd792b002436d91ccd0fe56486817fc3284405 (patch)
treec0c0e12589894bbe48b6b9c8012666f535f20cb6 /plugins/SimulationView
parent99a5aa363f3414b65a63a81352ebaa91f1138e93 (diff)
Convert Layerview component to controls 2
Diffstat (limited to 'plugins/SimulationView')
-rw-r--r--plugins/SimulationView/SimulationSliderLabel.qml55
-rw-r--r--plugins/SimulationView/SimulationViewMainComponent.qml1
-rw-r--r--plugins/SimulationView/SimulationViewMenuComponent.qml1
3 files changed, 25 insertions, 32 deletions
diff --git a/plugins/SimulationView/SimulationSliderLabel.qml b/plugins/SimulationView/SimulationSliderLabel.qml
index afd02069eb..850fff7440 100644
--- a/plugins/SimulationView/SimulationSliderLabel.qml
+++ b/plugins/SimulationView/SimulationSliderLabel.qml
@@ -1,14 +1,14 @@
-// Copyright (c) 2017 Ultimaker B.V.
+// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.5
-import QtQuick.Controls 1.2
+import QtQuick.Controls 2.2
import QtQuick.Layouts 1.1
-import QtQuick.Controls.Styles 1.1
import UM 1.0 as UM
import Cura 1.0 as Cura
-UM.PointingRectangle {
+UM.PointingRectangle
+{
id: sliderLabelRoot
// custom properties
@@ -28,47 +28,40 @@ UM.PointingRectangle {
borderColor: UM.Theme.getColor("lining")
borderWidth: UM.Theme.getSize("default_lining").width
- Behavior on height {
- NumberAnimation {
- duration: 50
- }
- }
+ Behavior on height { NumberAnimation { duration: 50 } }
// catch all mouse events so they're not handled by underlying 3D scene
- MouseArea {
+ MouseArea
+ {
anchors.fill: parent
}
- TextMetrics {
+ TextMetrics
+ {
id: maxValueMetrics
font: valueLabel.font
text: maximumValue + 1 // layers are 0 based, add 1 for display value
-
}
- TextField {
+ TextField
+ {
id: valueLabel
- anchors {
- verticalCenter: parent.verticalCenter
- horizontalCenter: parent.horizontalCenter
- alignWhenCentered: false
- }
+ anchors.centerIn: parent
- width: maxValueMetrics.width + UM.Theme.getSize("default_margin").width
+ //width: maxValueMetrics.contentWidth + 2 * UM.Theme.getSize("default_margin").width
text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array
horizontalAlignment: TextInput.AlignHCenter
+ leftPadding: UM.Theme.getSize("narrow_margin").width
+ rightPadding: UM.Theme.getSize("narrow_margin").width
// key bindings, work when label is currently focused (active handle in LayerSlider)
Keys.onUpPressed: sliderLabelRoot.setValue(sliderLabelRoot.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
Keys.onDownPressed: sliderLabelRoot.setValue(sliderLabelRoot.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
-
- style: TextFieldStyle {
- textColor: UM.Theme.getColor("text")
- font: UM.Theme.getFont("default")
- renderType: Text.NativeRendering
- background: Item { }
- }
+ color: UM.Theme.getColor("text")
+ font: UM.Theme.getFont("default")
+ renderType: Text.NativeRendering
+ background: Item {}
onEditingFinished: {
@@ -84,16 +77,18 @@ UM.PointingRectangle {
}
}
- validator: IntValidator {
+ validator: IntValidator
+ {
bottom: startFrom
top: sliderLabelRoot.maximumValue + startFrom // +startFrom because maybe we want to start in a different value rather than 0
}
}
-
- BusyIndicator {
+ BusyIndicator
+ {
id: busyIndicator
- anchors {
+ anchors
+ {
left: parent.right
leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
verticalCenter: parent.verticalCenter
diff --git a/plugins/SimulationView/SimulationViewMainComponent.qml b/plugins/SimulationView/SimulationViewMainComponent.qml
index af60692273..aaea15025e 100644
--- a/plugins/SimulationView/SimulationViewMainComponent.qml
+++ b/plugins/SimulationView/SimulationViewMainComponent.qml
@@ -2,7 +2,6 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.4
-import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml
index 379da63c28..1e58fb23bb 100644
--- a/plugins/SimulationView/SimulationViewMenuComponent.qml
+++ b/plugins/SimulationView/SimulationViewMenuComponent.qml
@@ -2,7 +2,6 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.4
-import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1
import QtGraphicalEffects 1.0