Warning, /plasma/plasma-bigscreen/lookandfeel/contents/splash/Splash.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2021 Aditya Mehra <aix.m@outlook.com> 0003 SPDX-FileCopyrightText: 2014 Marco Martin <mart@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 import QtQuick 2.5 0009 import QtQuick.Layouts 1.3 0010 import QtQuick.Window 2.2 0011 import org.kde.mycroft.bigscreen 1.0 as BigScreen 0012 0013 Rectangle { 0014 id: root 0015 color: "black" 0016 anchors.fill: parent 0017 property int stage 0018 property var envReader: BigScreen.EnvReader 0019 0020 // Workaround For Devices Where We Don't Support 4K Scaling 0021 // Using PLASMA_USE_QT_SCALING with QT_SCREEN_SCALE_FACTORS causes a bug where parent screen geometry does not change when applying 1980x1800 resolution via Kscreen-Doctor 0022 function disableScale(){ 0023 if(envReader.getValue("PLASMA_USE_QT_SCALING") == "true" && envReader.getValue("BIGSCREEN_HARDWARE_PLATFORM") == "RPI4" && root.width > 1920) { 0024 content.width = root.width / 2 0025 content.height = root.height / 2 0026 content.visible = true 0027 } 0028 } 0029 0030 Connections { 0031 target: BigScreen.EnvReader 0032 onConfigChangeReceived: { 0033 disableScale(); 0034 } 0035 } 0036 0037 onStageChanged: { 0038 if (stage == 2) { 0039 introAnimation.running = true; 0040 } else if (stage == 5) { 0041 introAnimation.target = busyIndicator; 0042 introAnimation.from = 1; 0043 introAnimation.to = 0; 0044 introAnimation.running = true; 0045 } 0046 } 0047 0048 Item { 0049 id: content 0050 width: parent.width 0051 height: parent.height 0052 opacity: 0 0053 0054 TextMetrics { 0055 id: units 0056 text: "M" 0057 property int gridUnit: boundingRect.height 0058 property int largeSpacing: units.gridUnit 0059 property int smallSpacing: Math.max(2, gridUnit/4) 0060 } 0061 0062 ColumnLayout { 0063 id: rootCol 0064 anchors.centerIn: parent 0065 width: parent.width 0066 0067 Text { 0068 id: welcomeMessage 0069 renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering 0070 text: i18n("Welcome") 0071 color: "white" 0072 font.pointSize: 34 0073 font.weight: Font.Normal 0074 font.family: "oxygen" 0075 Layout.alignment: Qt.AlignHCenter 0076 } 0077 0078 Image { 0079 id: busyIndicator 0080 Layout.alignment: Qt.AlignHCenter 0081 source: "images/busycolored.svg" 0082 sourceSize.height: units.gridUnit * 2 0083 sourceSize.width: units.gridUnit * 2 0084 RotationAnimator on rotation { 0085 id: rotationAnimator 0086 from: 0 0087 to: 360 0088 duration: 1500 0089 loops: Animation.Infinite 0090 } 0091 } 0092 0093 Image { 0094 id: logo 0095 Layout.alignment: Qt.AlignHCenter 0096 property real size: units.gridUnit * 5 0097 source: "images/logo-big.svg" 0098 sourceSize.width: size + units.gridUnit * 12 0099 sourceSize.height: size 0100 } 0101 } 0102 0103 Row { 0104 spacing: units.smallSpacing*2 0105 anchors { 0106 bottom: parent.bottom 0107 right: parent.right 0108 margins: units.gridUnit 0109 } 0110 Text { 0111 color: "#eff0f1" 0112 // Work around Qt bug where NativeRendering breaks for non-integer scale factors 0113 // https://bugreports.qt.io/browse/QTBUG-67007 0114 renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering 0115 anchors.verticalCenter: parent.verticalCenter 0116 text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "This is the first text the user sees while starting in the splash screen, should be translated as something short, is a form that can be seen on a product. Plasma is the project name so shouldn't be translated.", "Plasma made by KDE") 0117 } 0118 Image { 0119 source: "images/kde.svgz" 0120 sourceSize.height: units.gridUnit * 2 0121 sourceSize.width: units.gridUnit * 2 0122 } 0123 } 0124 } 0125 0126 OpacityAnimator { 0127 id: introAnimation 0128 running: false 0129 target: content 0130 from: 0 0131 to: 1 0132 duration: 1000 0133 easing.type: Easing.InOutQuad 0134 } 0135 }