diff options
author | Frederik Schwarzer <frederik.schwarzer@basyskom.com> | 2016-10-04 11:48:22 +0200 |
---|---|---|
committer | Frederik Schwarzer <frederik.schwarzer@basyskom.com> | 2016-10-04 12:24:34 +0000 |
commit | 736bf3dc886701c60fea755f5a58793e6b2e0ca5 (patch) | |
tree | 72348e990799c9545fc523195f3f6c9a07942978 /src/imports/controls/doc | |
parent | a03c84d9a8d419f110db46b87db19d27cf675f44 (diff) |
Fix example customization code for Dial
Now it also works when copied into a file inside other elements.
Change-Id: I715724ed8c5ff5171680192630f02e029478fd03
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/doc')
-rw-r--r-- | src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml index 658acc4b..efe061d3 100644 --- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml +++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml @@ -44,8 +44,8 @@ Dial { handle: Rectangle { id: handleItem - x: background.x + background.width / 2 - handle.width / 2 - y: background.y + background.height / 2 - handle.height / 2 + x: control.background.x + control.background.width / 2 - width / 2 + y: control.background.y + control.background.height / 2 - height / 2 width: 16 height: 16 color: control.pressed ? "#17a81a" : "#21be2b" @@ -54,12 +54,12 @@ Dial { opacity: control.enabled ? 1 : 0.3 transform: [ Translate { - y: -Math.min(background.width, background.height) * 0.4 + handle.height / 2 + y: -Math.min(control.background.width, control.background.height) * 0.4 + handleItem.height / 2 }, Rotation { angle: control.angle - origin.x: handle.width / 2 - origin.y: handle.height / 2 + origin.x: handleItem.width / 2 + origin.y: handleItem.height / 2 } ] } |