aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-01-18 12:19:27 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-01-18 11:29:45 +0000
commit26056b52b182b4452855f54a2c811d64246c434a (patch)
treef30a5afdc278f39515600bd9da5e8a187357d943 /src
parent8244e2e36af2f6923c5be586da37c0facf7152a8 (diff)
Imagine/Switch(Delegate): cleanup internal IDs for deferred execution
Task-number: QTBUG-50992 Change-Id: I621343bef562b4ed85202a0690a0cccfc0a053c5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/imagine/Switch.qml5
-rw-r--r--src/imports/controls/imagine/SwitchDelegate.qml5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/imports/controls/imagine/Switch.qml b/src/imports/controls/imagine/Switch.qml
index 6d69502d..c7cc8ecb 100644
--- a/src/imports/controls/imagine/Switch.qml
+++ b/src/imports/controls/imagine/Switch.qml
@@ -74,12 +74,13 @@ T.Switch {
]
}
- NinePatchImage {
- id: handle
+ property NinePatchImage handle: NinePatchImage {
readonly property real minPos: parent.leftPadding - leftPadding
readonly property real maxPos: parent.width - width + rightPadding - parent.rightPadding
readonly property real dragPos: control.visualPosition * parent.width - (width / 2)
+ parent: control.indicator
+
x: Math.max(minPos, Math.min(maxPos, control.visualPosition * parent.width - (width / 2)))
y: (parent.height - height) / 2
diff --git a/src/imports/controls/imagine/SwitchDelegate.qml b/src/imports/controls/imagine/SwitchDelegate.qml
index 0c9bfb15..625595d7 100644
--- a/src/imports/controls/imagine/SwitchDelegate.qml
+++ b/src/imports/controls/imagine/SwitchDelegate.qml
@@ -81,12 +81,13 @@ T.SwitchDelegate {
]
}
- NinePatchImage {
- id: handle
+ property NinePatchImage handle: NinePatchImage {
readonly property real minPos: parent.leftPadding - leftPadding
readonly property real maxPos: parent.width - width + rightPadding - parent.rightPadding
readonly property real dragPos: control.visualPosition * parent.width - (width / 2)
+ parent: control.indicator
+
x: Math.max(minPos, Math.min(maxPos, control.visualPosition * parent.width - (width / 2)))
y: (parent.height - height) / 2