From 736bf3dc886701c60fea755f5a58793e6b2e0ca5 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Tue, 4 Oct 2016 11:48:22 +0200 Subject: 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 Reviewed-by: Mitch Curtis --- .../doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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 } ] } -- cgit v1.2.3