-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.qml
76 lines (67 loc) · 2.5 KB
/
theme.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
import QtQuick 2.8
import QtGraphicalEffects 1.12
FocusScope {
Component.onCompleted: {
collectionsView.currentCollectionIndex = api.memory.get('collectionIndex') || 0;
}
FontLoader {id: generalFont; source: "fonts/Rubik-Regular.ttf" }
FontLoader {id: headerFont; source: "fonts/OpenSans-ExtraBold.ttf" }
FontLoader {id: subheaderFont; source: "fonts/FredokaOne-Regular.ttf" }
StarField {
currentCollection: collectionsView.currentCollection
anchors {
left: parent.left
}
}
CollectionsView {
id: collectionsView
anchors.bottom: parent.bottom
focus: true
onCollectionSelected: {
detailsView.currentGameIndex = api.memory.get(currentCollection.shortName + 'GameIndex') || 0;
detailsView.focus = true
}
}
DetailsView {
id: detailsView
anchors.top: collectionsView.bottom
currentCollection: collectionsView.currentCollection
onCancel: {
api.memory.set('collectionIndex', collectionsView.currentCollectionIndex);
api.memory.set(currentCollection.shortName + 'GameIndex', currentGameIndex);
collectionsView.focus = true
}
onNextCollection: {
api.memory.set('collectionIndex', collectionsView.currentCollectionIndex);
api.memory.set(currentCollection.shortName + 'GameIndex', currentGameIndex);
collectionsView.selectNext()
detailsView.currentGameIndex = api.memory.get(currentCollection.shortName + 'GameIndex') || 0;
}
onPrevCollection: {
api.memory.set('collectionIndex', collectionsView.currentCollectionIndex);
api.memory.set(currentCollection.shortName + 'GameIndex', currentGameIndex);
collectionsView.selectPrev()
detailsView.currentGameIndex = api.memory.get(currentCollection.shortName + 'GameIndex') || 0;
}
onLaunchGame: {
api.memory.set('collectionIndex', collectionsView.currentCollectionIndex);
api.memory.set(currentCollection.shortName + 'GameIndex', currentGameIndex);
currentGame.launch();
}
}
states: [
State {
when: detailsView.focus
AnchorChanges {
target: collectionsView;
anchors.bottom: parent.top
}
}
]
transitions: Transition {
AnchorAnimation {
duration: 666
easing.type: Easing.OutExpo
}
}
}