-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainMenu.qml
52 lines (42 loc) · 1.09 KB
/
MainMenu.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
import QtQuick 2.0
import "qml_ui"
Item {
id: mainMenuContainer
signal requestStackChange(var stack, var properties)
property var title: "Block Wars"
ListView {
id: mainMenuListView
anchors.centerIn: parent
width: { return parent.width * 0.8 }
height: { return parent.height * 0.8 }
model: mainMenuModel
delegate: MainMenuButton {
text: model.text
width: { return mainMenuListView.width }
height: { return mainMenuListView.height / mainMenuModel.count }
onMenuButtonClicked: {
mainMenuContainer.requestStackChange(model.stack, {});
}
}
}
ListModel {
id: mainMenuModel
ListElement {
text: "Single Player"
stack: "SinglePlayer.qml"
}
ListElement {
text: "Multiplayer"
stack: "Multiplayer.qml"
}
ListElement {
text: "Customize"
}
ListElement {
text: "Settings"
}
ListElement {
text: "Exit"
}
}
}