2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2022-05-20 17:14:39 +00:00
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-05-20 17:14:39 +00:00
|
|
|
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
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.bottomMargin: Theme.padding
|
2022-05-20 17:14:39 +00:00
|
|
|
fillMode: Image.PreserveAspectFit
|
2024-10-15 19:26:12 +00:00
|
|
|
source: Theme.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
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.secondaryText
|
2022-05-20 17:14:39 +00:00
|
|
|
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
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.padding
|
|
|
|
font.pixelSize: Theme.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
|
2024-10-15 19:26:12 +00:00
|
|
|
leftPadding: Theme.padding
|
|
|
|
rightPadding: Theme.padding
|
2022-07-26 14:16:23 +00:00
|
|
|
font.weight: Font.Medium
|
2024-04-24 16:31:22 +00:00
|
|
|
text: qsTr("Start using Status")
|
2022-05-20 17:14:39 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|