diff options
Diffstat (limited to 'examples/quickcontrols/wearable/WearableStyle/PageIndicator.qml')
-rw-r--r-- | examples/quickcontrols/wearable/WearableStyle/PageIndicator.qml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/quickcontrols/wearable/WearableStyle/PageIndicator.qml b/examples/quickcontrols/wearable/WearableStyle/PageIndicator.qml new file mode 100644 index 0000000000..bfc25c78d1 --- /dev/null +++ b/examples/quickcontrols/wearable/WearableStyle/PageIndicator.qml @@ -0,0 +1,42 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Templates as T + +T.PageIndicator { + id: control + + implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding + implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding + + spacing: 6 + padding: 6 + bottomPadding: 7 + + delegate: Rectangle { + required property int index + + implicitWidth: 16 + implicitHeight: 16 + + radius: width / 2 + color: index === control.currentIndex ? UIStyle.buttonProgress : UIStyle.pageIndicatorColor + border.color: UIStyle.indicatorOutlineColor + + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } + + contentItem: Row { + spacing: control.spacing + + Repeater { + model: control.count + delegate: control.delegate + } + } +} |