aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/components/designer/SvgPathItemSpecifics.qml
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2022-11-25 17:47:49 +0100
committerHenning Gruendl <henning.gruendl@qt.io>2022-11-28 12:45:23 +0100
commiteef765c5ed34eac8c1294fbeda55d273f916ca86 (patch)
tree09d25fdaf312288d84f8eed3874a2405b7529e09 /src/imports/components/designer/SvgPathItemSpecifics.qml
parent728b7a681e4a6243f28af61dd84aa1ceddd80144 (diff)
Store previous strokeWidth to re-use when shown
Store the previously set strokeWidth on all ShapePath related item specifics. This allows to revert to the previous value when stroke is hidden and shown again. Task-number: QDS-8191 Change-Id: Iea68e6dd726ce3fea8aedbe268b1822e0d7d19ea Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/imports/components/designer/SvgPathItemSpecifics.qml')
-rw-r--r--src/imports/components/designer/SvgPathItemSpecifics.qml20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/imports/components/designer/SvgPathItemSpecifics.qml b/src/imports/components/designer/SvgPathItemSpecifics.qml
index 77b7875..9cbc47f 100644
--- a/src/imports/components/designer/SvgPathItemSpecifics.qml
+++ b/src/imports/components/designer/SvgPathItemSpecifics.qml
@@ -62,6 +62,7 @@ Column {
SecondColumnLayout {
SpinBox {
+ id: strokeWidthSpinBox
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
backendValue: backendValues.strokeWidth
@@ -69,6 +70,16 @@ Column {
minimumValue: -1
maximumValue: 200
stepSize: 1
+
+ property real previousValue: 0
+
+ onValueChanged: {
+ if (strokeWidthSpinBox.value > 0)
+ strokeWidthSpinBox.previousValue = strokeWidthSpinBox.value
+ }
+
+ Component.onCompleted: strokeWidthSpinBox.previousValue
+ = Math.max(1, backendValues.strokeWidth.value)
}
Spacer {
@@ -77,13 +88,14 @@ Column {
}
StudioControls.CheckBox {
- id: strokeWidthCheck
+ id: strokeWidthCheckBox
text: qsTr("Hide")
- checked: backendValues.strokeWidth.value < 0
- actionIndicator.visible: false
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ checked: (backendValues.strokeWidth.value < 0)
+ actionIndicator.visible: false
- onClicked: backendValues.strokeWidth.value = strokeWidthCheck.checked ? -1 : 4
+ onClicked: backendValues.strokeWidth.value
+ = (strokeWidthCheckBox.checked ? -1 : strokeWidthSpinBox.previousValue)
}
ExpandingSpacer {}