From 563ee6816a3609a61ac4fc0816aeac619a21c1ef Mon Sep 17 00:00:00 2001 From: jarolrod Date: Tue, 4 Jan 2022 13:19:35 -0500 Subject: [PATCH] qml: introduce PageIndicator control --- src/Makefile.qt.include | 1 + src/qml/bitcoin_qml.qrc | 1 + src/qml/controls/PageIndicator.qml | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 src/qml/controls/PageIndicator.qml diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index aa0dd7bdbb..9d8ffa1440 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -303,6 +303,7 @@ QML_RES_QML = \ qml/components/StorageOptions.qml \ qml/controls/ContinueButton.qml \ qml/controls/Header.qml \ + qml/controls/PageIndicator.qml \ qml/controls/OptionButton.qml \ qml/controls/OptionSwitch.qml \ qml/controls/ProgressIndicator.qml \ diff --git a/src/qml/bitcoin_qml.qrc b/src/qml/bitcoin_qml.qrc index fde4e5af3b..fde697d1cf 100644 --- a/src/qml/bitcoin_qml.qrc +++ b/src/qml/bitcoin_qml.qrc @@ -6,6 +6,7 @@ components/StorageOptions.qml controls/ContinueButton.qml controls/Header.qml + controls/PageIndicator.qml controls/OptionButton.qml controls/OptionSwitch.qml controls/ProgressIndicator.qml diff --git a/src/qml/controls/PageIndicator.qml b/src/qml/controls/PageIndicator.qml new file mode 100644 index 0000000000..29e2ac49c0 --- /dev/null +++ b/src/qml/controls/PageIndicator.qml @@ -0,0 +1,22 @@ +// Copyright (c) 2022 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +PageIndicator { + id: root + delegate: Rectangle { + implicitWidth: 10 + implicitHeight: 10 + radius: Math.round(width / 2) + color: "white" + opacity: index === root.currentIndex ? 0.95 : pressed ? 0.7 : 0.45 + Behavior on opacity { + OpacityAnimator { + duration: 100 + } + } + } +}