Main.qml
1.13 KB
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
import QtQuick
import QtQuick.Controls.Basic
import QtQuick.Layouts
import QtQuick.Window
import "." as App
ApplicationWindow {
id: window
visible: true
width: 1280
height: 880
minimumWidth: 1100
minimumHeight: 760
title: appState.loggedIn
? "珠宝壹佰图像生成器"
: "登录 - 珠宝壹佰图像生成器"
color: App.Theme.bgCanvas
// 登录前 400x460 小窗,登录后 1280x880 主窗口
Component.onCompleted: updateGeometry()
Connections {
target: appState
function onLoggedInChanged() {
updateGeometry()
}
}
function updateGeometry() {
if (appState.loggedIn) {
window.minimumWidth = 1100
window.minimumHeight = 820
window.width = 1280
window.height = 940
} else {
window.minimumWidth = 360
window.minimumHeight = 420
window.width = 400
window.height = 480
}
}
StackLayout {
anchors.fill: parent
currentIndex: appState.loggedIn ? 1 : 0
LoginScreen {}
MainWindow {}
}
}