-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
79 lines (64 loc) · 1.48 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
import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.1
import Material 0.1 as Material
import com.Kanari.GomokuDuel 1.0
Material.ApplicationWindow {
id: window
visible: true
clientSideDecorations: true
color: "black"
title: qsTr("Gomoku Duel")
property bool largeScreen: Screen.desktopAvailableHeight >= 900
width: largeScreen ? 1200 : 920
height: largeScreen? 900 : 690
// maximumHeight: minimumHeight
// maximumWidth: minimumWidth
property double scale: width / 1600
onClosing: {
close.accepted = false
confirmQuitDialog.show()
}
Material.Dialog {
id: confirmQuitDialog
title: qsTr("Confirm quit", "quit dialog")
text: qsTr("Are you sure you want to quit?")
positiveButtonText: "Yes"
negativeButtonText: "No"
onAccepted: quitAnimation.start()
}
SequentialAnimation {
id: quitAnimation
running: false
PauseAnimation {
duration: 200
}
ParallelAnimation {
PropertyAnimation {
target: pageStack; property: "opacity"
duration: 750; from: 1.0; to: 0.0
}
PropertyAnimation {
target: bg; property: "opacity"
duration: 900; from: 1.0; to: 0.0
}
}
ScriptAction {
script: Qt.quit()
}
}
Image {
id: bg
z: -1
source: "qrc:/image/background.jpg"
anchors.fill: parent
fillMode: Image.Stretch
}
initialPage: MainPage {
Component.onCompleted: {
Material.Units.multiplier = window.largeScreen ? 2.0 : 1.0
console.log(Material.Units.multiplier)
}
}
}