-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.qml
139 lines (121 loc) · 3.89 KB
/
Main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import QtQuick 2.0
import SddmComponents 2.0
import QtQuick.Layouts 1.0
import QtQuick.VirtualKeyboard 2.15
import QtQuick.VirtualKeyboard.Styles 2.15
import QtQuick.Window 2.2
Rectangle {
id: container
anchors.fill: parent
LayoutMirroring.enabled: Qt.locale().textDirection == Qt.RightToLeft
LayoutMirroring.childrenInherit: true
Background {
anchors.fill: parent
source: config.background
fillMode: Image.Tile
onStatusChanged: {
if (status == Image.Error) {
color = "grey"
}
}
}
ColumnLayout{
property int heightModifier: 0;
property var startupFinished: false
id: thisColumn
width:parent.width
Behavior on height {
id: heightBehaviour
enabled: false
PropertyAnimation {} }
height: loginPrompt.animationHack
? thisColumn.height
: ( parent.height + heightModifier - (
(virtualKeyboard.keyboardActive && ( config.keyboardMoveWindow == "true" ) && startupFinished)
? virtualKeyboard.implicitHeight*0.40
: 0))
LoginPrompt{
id: loginPrompt
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.preferredWidth: 577
Layout.preferredHeight: 275
opacity: 0
Component.onCompleted: {
if(config.startupAnimationFade == "true"){
loginPromptFade.start();
}else{
opacity = 1;
}
}
PropertyAnimation {
id: loginPromptFade
target: loginPrompt
property: "opacity"
to: 1
easing.type: Easing.InQuint
duration: 500
}
}
PauseAnimation {
id: startupPause
duration: 400
}
PropertyAnimation {
id: moveColumn
target: thisColumn
property: "heightModifier"
from: -loginPrompt.height*1.7
to: 0
duration: 400
}
Component.onCompleted: {
if(config.startupAnimationMove == "true"){
moveColumn.start();
}else{
startupPause.start();
}
}
Connections{
target: moveColumn
onFinished: {
thisColumn.startupFinished = true;
heightBehaviour.enabled = true;
}
}
Connections{
target: startupPause
onFinished: {
thisColumn.startupFinished = true;
heightBehaviour.enabled = true;
}
}
}
Connections{
target: loginPrompt
onOpenKeyboard: virtualKeyboard.show()
onCloseKeyboard: virtualKeyboard.hide()
}
Loader {
id: virtualKeyboard
z: 200
anchors.fill:parent
state: "hidden"
source: "VirtualKeyboard.qml"
property bool keyboardActive: item ? item.active : false
onKeyboardActiveChanged: state = keyboardActive ? "visible" : "hidden"
function show() {
state = "visible";
Qt.inputMethod.show();
virtualKeyboard.item.activated = true;
}
function hide() {
state = "hidden";
Qt.inputMethod.hide();
virtualKeyboard.item.activated = false;
}
}
Component.onCompleted: {
loginPrompt.sessionBox.model = sessionModel;
loginPrompt.sessionBox.currentIndex = sessionModel.lastIndex;
}
}