mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-22 03:28:52 +00:00
- implement the basic Onboarding UI skeleton and the Create Profile flows - adjust the PasswordView and EnterSeedPhrase views to the latest design - add the main OnboardingLayout and StatusPinInput pages to Storybook - change terminology app-wide: "Seed phrase" -> "Recovery phrase" - implement the Login flows (seed, sync, keycard) - amend the keycard flow sequences with separate (non) empty page Fixes #16719 Fixes #16742 Fixes #16743
110 lines
3.5 KiB
QML
110 lines
3.5 KiB
QML
import QtQuick 2.15
|
|
import QtQuick.Controls 2.15
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import StatusQ.Core 0.1
|
|
import StatusQ.Components 0.1
|
|
import StatusQ.Controls 0.1
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
Control {
|
|
id: root
|
|
|
|
// [{primary:string, secondary:string, image:string}]
|
|
required property var newsModel
|
|
|
|
background: Rectangle {
|
|
color: StatusColors.colors["neutral-95"]
|
|
radius: 20
|
|
}
|
|
|
|
verticalPadding: Theme.xlPadding
|
|
horizontalPadding: Theme.xlPadding * 2
|
|
|
|
contentItem: ColumnLayout {
|
|
id: newsPage
|
|
readonly property string primaryText: root.newsModel.get(pageIndicator.currentIndex).primary
|
|
readonly property string secondaryText: root.newsModel.get(pageIndicator.currentIndex).secondary
|
|
|
|
spacing: Theme.halfPadding
|
|
|
|
Image {
|
|
Layout.fillWidth: true
|
|
Layout.maximumWidth: 460
|
|
Layout.fillHeight: true
|
|
Layout.maximumHeight: 582
|
|
Layout.alignment: Qt.AlignHCenter
|
|
fillMode: Image.PreserveAspectFit
|
|
asynchronous: true
|
|
source: Theme.png(root.newsModel.get(pageIndicator.currentIndex).image)
|
|
}
|
|
|
|
StatusBaseText {
|
|
Layout.fillWidth: true
|
|
text: newsPage.primaryText
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.weight: Font.DemiBold
|
|
color: Theme.palette.white
|
|
wrapMode: Text.WordWrap
|
|
}
|
|
|
|
StatusBaseText {
|
|
Layout.fillWidth: true
|
|
text: newsPage.secondaryText
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pixelSize: Theme.additionalTextSize
|
|
color: Theme.palette.white
|
|
wrapMode: Text.WordWrap
|
|
}
|
|
|
|
PageIndicator {
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
|
Layout.topMargin: Theme.smallPadding
|
|
Layout.maximumWidth: parent.width
|
|
id: pageIndicator
|
|
interactive: true
|
|
count: root.newsModel.count
|
|
currentIndex: -1
|
|
Component.onCompleted: currentIndex = 0 // start switching pages
|
|
|
|
function switchToNextOrFirstPage() {
|
|
currentIndex = (currentIndex + 1) % count
|
|
}
|
|
|
|
delegate: Control {
|
|
id: pageIndicatorDelegate
|
|
implicitWidth: 44
|
|
implicitHeight: 8
|
|
|
|
readonly property bool isCurrentPage: index === pageIndicator.currentIndex
|
|
|
|
background: Rectangle {
|
|
color: Qt.rgba(1, 1, 1, 0.1)
|
|
radius: 4
|
|
HoverHandler {
|
|
cursorShape: hovered ? Qt.PointingHandCursor : undefined
|
|
}
|
|
}
|
|
contentItem: Item {
|
|
Rectangle {
|
|
NumberAnimation on width {
|
|
from: 0
|
|
to: pageIndicatorDelegate.availableWidth
|
|
duration: 3000
|
|
running: pageIndicatorDelegate.isCurrentPage
|
|
onStopped: {
|
|
if (pageIndicatorDelegate.isCurrentPage)
|
|
pageIndicator.switchToNextOrFirstPage()
|
|
}
|
|
}
|
|
|
|
height: parent.height
|
|
color: pageIndicatorDelegate.isCurrentPage ? Theme.palette.white : "transparent"
|
|
radius: 4
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|