diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-01-21 07:23:08 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-24 23:33:49 +0000 |
commit | be61a2b8aa804bc8de4fd7677f6ddff4ddb25413 (patch) | |
tree | 0228b07f32e2183576c599de270b48102e82bf0e /examples | |
parent | eb8d3d37ef2e5d208f5c456a76738d847e1496b2 (diff) |
Disambiguate "parent" in flatstyle example
Amends d7862eac1b09f9fb28e540970d5cc98cb6479c52
"rectangle" wasn't a good name for the circular knob part of the switch.
By using a more unique name "nub" we can make it a bit easier to read and
avoid using "parent" at all. https://en.wiktionary.org/wiki/nub
Fixes: QTBUG-100110
Change-Id: I428dc6d8463af4ea7e5890145fd40590fed4bcbe
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit f9834fa3c7aaf64450dca4bd3d1e0208eb021cf3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml b/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml index 783fae3abc..51bb388c87 100644 --- a/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml +++ b/examples/quickcontrols2/flatstyle/imports/Flat/Switch.qml @@ -78,7 +78,7 @@ T.Switch { border.color: Theme.lightGray Rectangle { - id: rectangle + id: nub width: Theme.baseSize * 2.6 height: Theme.baseSize * 2.6 @@ -101,7 +101,7 @@ T.Switch { color: Theme.mainColor border.color: Theme.mainColor } - rectangle.x: parent.width - width + nub.x: switchHandle.width - nub.width } }, @@ -110,7 +110,7 @@ T.Switch { when: !control.checked && control.down PropertyChanges { - rectangle.color: Theme.light + nub.color: Theme.light } }, @@ -120,8 +120,8 @@ T.Switch { when: control.checked && control.down PropertyChanges { - rectangle { - x: parent.width - width + nub { + x: switchHandle.width - nub.width color: Theme.light } switchHandle { |