feat(@desktop/onboarding): Show Allow Notification page during first run
Issue #5583
This commit is contained in:
parent
5c3aee481b
commit
c9910ee38b
|
@ -21,7 +21,18 @@ QtObject {
|
||||||
|
|
||||||
DSM.State {
|
DSM.State {
|
||||||
id: onboardingState
|
id: onboardingState
|
||||||
initialState: root.hasAccounts ? stateLogin : welcomeMainState
|
initialState: root.hasAccounts ? stateLogin : (Qt.platform.os === "osx" ? allowNotificationsState : welcomeMainState)
|
||||||
|
|
||||||
|
DSM.State {
|
||||||
|
id: allowNotificationsState
|
||||||
|
onEntered: { onBoardingStepChanged(allowNotificationsMain, ""); }
|
||||||
|
|
||||||
|
DSM.SignalTransition {
|
||||||
|
targetState: welcomeMainState
|
||||||
|
signal: Global.applicationWindow.navigateTo
|
||||||
|
guard: path === "WelcomeMain"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DSM.State {
|
DSM.State {
|
||||||
id: welcomeMainState
|
id: welcomeMainState
|
||||||
|
@ -171,6 +182,15 @@ QtObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property var allowNotificationsComponent: Component {
|
||||||
|
id: allowNotificationsMain
|
||||||
|
AllowNotificationsView {
|
||||||
|
onBtnOkClicked: {
|
||||||
|
Global.applicationWindow.navigateTo("WelcomeMain");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property var welcomeComponent: Component {
|
property var welcomeComponent: Component {
|
||||||
id: welcomeMain
|
id: welcomeMain
|
||||||
WelcomeView {
|
WelcomeView {
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
import QtQuick 2.13
|
||||||
|
import QtQuick.Controls 2.13
|
||||||
|
|
||||||
|
import StatusQ.Controls 0.1
|
||||||
|
|
||||||
|
import shared 1.0
|
||||||
|
import shared.panels 1.0
|
||||||
|
|
||||||
|
import utils 1.0
|
||||||
|
|
||||||
|
import "../controls"
|
||||||
|
|
||||||
|
OnboardingBasePage {
|
||||||
|
id: page
|
||||||
|
|
||||||
|
signal btnOkClicked()
|
||||||
|
|
||||||
|
backButtonVisible: false
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
readonly property int titlePixelSize: 22
|
||||||
|
readonly property real titleLetterSpacing: -0.2
|
||||||
|
readonly property int okButtonTopMargin: 40
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: notificationImg
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.bottom: txtTitle.top
|
||||||
|
anchors.bottomMargin: Style.current.padding
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
source: Style.png("onboarding/notifications@2x")
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: txtTitle
|
||||||
|
text: qsTr("Allow notifications")
|
||||||
|
font.bold: true
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
font.letterSpacing: d.titleLetterSpacing
|
||||||
|
font.pixelSize: d.titlePixelSize
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: txtDesc
|
||||||
|
color: Style.current.secondaryText
|
||||||
|
text: qsTr("Status will notify you about new messages. You can\nedit your notification preferences later in settings.")
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.top: txtTitle.bottom
|
||||||
|
anchors.topMargin: Style.current.padding
|
||||||
|
font.pixelSize: Style.current.primaryTextFontSize
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusButton {
|
||||||
|
id: btnOk
|
||||||
|
anchors.top: txtDesc.bottom
|
||||||
|
anchors.topMargin: d.okButtonTopMargin
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
text: qsTr("Ok, got it")
|
||||||
|
onClicked: {
|
||||||
|
page.btnOkClicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Loading…
Reference in New Issue