2022-05-20 17:14:39 +00:00
|
|
|
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
|
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
import "../stores"
|
2022-05-20 17:14:39 +00:00
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
Item {
|
|
|
|
id: root
|
2022-05-20 17:14:39 +00:00
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
property StartupStore startupStore
|
2022-05-20 17:14:39 +00:00
|
|
|
|
2023-04-03 09:15:34 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
btnOk.forceActiveFocus()
|
|
|
|
}
|
|
|
|
|
2022-05-20 17:14:39 +00:00
|
|
|
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")
|
2023-04-26 15:33:24 +00:00
|
|
|
cache: false
|
2022-05-20 17:14:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2022-07-26 14:16:23 +00:00
|
|
|
lineHeight: 1.2
|
2022-05-20 17:14:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2022-07-26 14:16:23 +00:00
|
|
|
lineHeight: 1.2
|
2022-05-20 17:14:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: btnOk
|
2022-07-29 22:51:34 +00:00
|
|
|
objectName: "allowNotificationsOnboardingOkButton"
|
2022-05-20 17:14:39 +00:00
|
|
|
anchors.top: txtDesc.bottom
|
|
|
|
anchors.topMargin: d.okButtonTopMargin
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-07-26 14:16:23 +00:00
|
|
|
leftPadding: Style.current.padding
|
|
|
|
rightPadding: Style.current.padding
|
|
|
|
font.weight: Font.Medium
|
2022-05-20 17:14:39 +00:00
|
|
|
text: qsTr("Ok, got it")
|
|
|
|
onClicked: {
|
2022-07-20 12:34:44 +00:00
|
|
|
root.startupStore.doPrimaryAction()
|
2022-05-20 17:14:39 +00:00
|
|
|
}
|
2023-04-03 09:15:34 +00:00
|
|
|
Keys.onPressed: {
|
|
|
|
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
|
|
|
event.accepted = true
|
|
|
|
root.startupStore.doPrimaryAction()
|
|
|
|
}
|
|
|
|
}
|
2022-05-20 17:14:39 +00:00
|
|
|
}
|
|
|
|
}
|