diff options
Diffstat (limited to 'examples/quick/keyinteraction/TabMenu.qml')
-rw-r--r-- | examples/quick/keyinteraction/TabMenu.qml | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/examples/quick/keyinteraction/TabMenu.qml b/examples/quick/keyinteraction/TabMenu.qml index e3c622aca1..04451b3206 100644 --- a/examples/quick/keyinteraction/TabMenu.qml +++ b/examples/quick/keyinteraction/TabMenu.qml @@ -1,6 +1,7 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +pragma ComponentBehavior: Bound import QtQuick FocusScope { @@ -12,19 +13,30 @@ FocusScope { anchors.fill: parent clip: true gradient: Gradient { - GradientStop { position: 0.0; color: "#193441" } - GradientStop { position: 1.0; color: Qt.darker("#193441") } + GradientStop { + position: 0.0 + color: "#193441" + } + GradientStop { + position: 1.0 + color: Qt.darker("#193441") + } } Row { id: tabView - anchors.fill: parent; anchors.leftMargin: 20; anchors.rightMargin: 20 + + anchors.fill: parent + anchors.leftMargin: 20 + anchors.rightMargin: 20 Repeater { activeFocusOnTab: false model: 5 Item { id: container - width: 152; height: 152 + + width: 152 + height: 152 activeFocusOnTab: true focus: true @@ -35,10 +47,21 @@ FocusScope { id: content color: "transparent" antialiasing: true - anchors.fill: parent; anchors.margins: 20; radius: 10 + anchors.fill: parent + anchors.margins: 20 + radius: 10 - Rectangle { color: "#91AA9D"; anchors.fill: parent; anchors.margins: 3; radius: 8; antialiasing: true } - Image { source: "images/qt-logo.png"; anchors.centerIn: parent } + Rectangle { + color: "#91AA9D" + anchors.fill: parent + anchors.margins: 3 + radius: 8 + antialiasing: true + } + Image { + source: "images/qt-logo.png" + anchors.centerIn: parent + } } MouseArea { @@ -52,7 +75,8 @@ FocusScope { } states: State { - name: "active"; when: container.activeFocus + name: "active" + when: container.activeFocus PropertyChanges { content { color: "#FCFFF5" @@ -62,7 +86,10 @@ FocusScope { } transitions: Transition { - NumberAnimation { properties: "scale"; duration: 100 } + NumberAnimation { + properties: "scale" + duration: 100 + } } } } |