2023-04-01 07:09:57 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
2024-01-27 16:49:30 +00:00
|
|
|
import QtCore
|
2023-04-01 07:09:57 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
2023-11-06 05:27:44 +00:00
|
|
|
|
2023-04-01 07:09:57 +00:00
|
|
|
import org.kde.kirigami 2.20 as Kirigami
|
|
|
|
|
|
2023-11-06 05:27:44 +00:00
|
|
|
import org.kde.plasma.mobileinitialstart.initialstart
|
2024-01-27 16:49:30 +00:00
|
|
|
import org.kde.plasma.mobileinitialstart.prepare 1.0 as Prepare
|
2023-11-06 05:27:44 +00:00
|
|
|
|
2023-04-01 07:09:57 +00:00
|
|
|
Item {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
readonly property real scaleStart: 1.4
|
|
|
|
|
readonly property real scaleLanding: 1.2
|
|
|
|
|
readonly property real scaleSteps: 1
|
|
|
|
|
|
|
|
|
|
signal requestNextPage()
|
|
|
|
|
|
|
|
|
|
function returnToLanding() {
|
|
|
|
|
backgroundImage.scale = scaleLanding;
|
|
|
|
|
contentOpacityAnim.to = 1;
|
|
|
|
|
contentOpacityAnim.restart();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
property real contentOpacity: 0
|
|
|
|
|
NumberAnimation on contentOpacity {
|
|
|
|
|
id: contentOpacityAnim
|
|
|
|
|
running: true
|
|
|
|
|
duration: 1000
|
|
|
|
|
to: 1
|
|
|
|
|
|
|
|
|
|
// shorten animation after initial run
|
|
|
|
|
onFinished: duration = 200
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Image {
|
|
|
|
|
id: backgroundImage
|
|
|
|
|
anchors.fill: parent
|
2024-01-31 15:39:35 +00:00
|
|
|
|
|
|
|
|
readonly property bool isLandscape: width >= height
|
|
|
|
|
|
2024-01-27 16:49:30 +00:00
|
|
|
source: {
|
2024-01-31 15:39:35 +00:00
|
|
|
// default wallpaper background
|
|
|
|
|
const imgFile = isLandscape ? '2560x1440.png' : '1080x1920.png';
|
|
|
|
|
const lightWallpaperFolder = 'wallpapers/Next/contents/images/';
|
|
|
|
|
const darkWallpaperFolder = 'wallpapers/Next/contents/images_dark/';
|
|
|
|
|
|
|
|
|
|
const wallpaperUrl = StandardPaths.locate(
|
2024-07-27 03:47:44 +00:00
|
|
|
StandardPaths.GenericDataLocation,
|
2024-01-31 15:39:35 +00:00
|
|
|
(Prepare.PrepareUtil.usingDarkTheme ? darkWallpaperFolder : lightWallpaperFolder) + imgFile
|
|
|
|
|
);
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2024-01-31 15:39:35 +00:00
|
|
|
if (!wallpaperUrl) {
|
|
|
|
|
return StandardPaths.locate(StandardPaths.GenericDataLocation, lightWallpaperFolder + imgFile);
|
2024-01-27 16:49:30 +00:00
|
|
|
}
|
2024-01-31 15:39:35 +00:00
|
|
|
return wallpaperUrl;
|
2024-01-27 16:49:30 +00:00
|
|
|
}
|
2023-04-01 07:09:57 +00:00
|
|
|
fillMode: Image.PreserveAspectCrop
|
|
|
|
|
|
|
|
|
|
opacity: 0
|
|
|
|
|
|
|
|
|
|
NumberAnimation on opacity {
|
|
|
|
|
running: true
|
|
|
|
|
duration: 400
|
|
|
|
|
to: 1
|
|
|
|
|
easing.type: Easing.InOutQuad
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// zoom animation
|
|
|
|
|
scale: scaleStart
|
|
|
|
|
Component.onCompleted: scale = scaleLanding
|
|
|
|
|
|
|
|
|
|
Behavior on scale {
|
|
|
|
|
NumberAnimation {
|
|
|
|
|
duration: 2000
|
|
|
|
|
easing.type: Easing.OutExpo
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// darken image slightly
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
color: Qt.rgba(0, 0, 0, 0.3)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
opacity: root.contentOpacity
|
2023-11-08 17:57:27 +00:00
|
|
|
spacing: Kirigami.Units.largeSpacing
|
2023-04-01 07:09:57 +00:00
|
|
|
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.leftMargin: Kirigami.Units.gridUnit * 4
|
|
|
|
|
anchors.rightMargin: Kirigami.Units.gridUnit * 4
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
2024-10-08 15:49:32 +00:00
|
|
|
text: i18n("Welcome to<br/><b>Plasma Mobile</b>")
|
2023-04-01 07:09:57 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
|
|
|
|
|
|
font.pointSize: 18
|
|
|
|
|
color: "white"
|
|
|
|
|
}
|
2024-10-08 15:49:32 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
opacity: root.contentOpacity
|
|
|
|
|
spacing: Kirigami.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
|
left: parent.left
|
|
|
|
|
right: parent.right
|
|
|
|
|
bottom: parent.bottom
|
|
|
|
|
leftMargin: Kirigami.Units.gridUnit * 4
|
|
|
|
|
rightMargin: Kirigami.Units.gridUnit * 4
|
|
|
|
|
bottomMargin: Kirigami.Units.gridUnit * 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Kirigami.Heading {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
text: i18n("Powered by<br/><b>%1</b>", InitialStartUtil.distroName)
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
|
|
|
|
|
|
level: 5
|
|
|
|
|
color: "white"
|
|
|
|
|
}
|
2023-04-01 07:09:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Button {
|
|
|
|
|
id: button
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.margins: Kirigami.Units.gridUnit
|
|
|
|
|
|
2023-10-21 22:27:31 +00:00
|
|
|
topPadding: Kirigami.Units.largeSpacing
|
|
|
|
|
bottomPadding: Kirigami.Units.largeSpacing
|
|
|
|
|
leftPadding: Kirigami.Units.largeSpacing
|
|
|
|
|
rightPadding: Kirigami.Units.largeSpacing
|
2023-04-01 07:09:57 +00:00
|
|
|
|
|
|
|
|
opacity: root.contentOpacity
|
|
|
|
|
text: i18n("Next")
|
|
|
|
|
icon.name: "go-next-symbolic"
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
backgroundImage.scale = scaleSteps;
|
|
|
|
|
contentOpacityAnim.to = 0;
|
|
|
|
|
contentOpacityAnim.restart();
|
|
|
|
|
root.requestNextPage()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|