forked from marcheing/projeto_mac0446
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainMenuColumn.qml
78 lines (71 loc) · 1.73 KB
/
MainMenuColumn.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
import QtQuick 2.0
import "Logic.js" as Logic
Column {
id: mainMenuColumn
spacing: 20
visible: true
Keys.onPressed: {
if(event.key === Qt.Key_Escape)
Qt.quit()
Logic.manage_speed(event, sweepingTime);
if(mainMenuColumn.visible && event.key === Qt.Key_Return)
{
Logic.manage_speed(event, sweepingTime);
if(alfabeto.focus)
{
root.state = "MenuAlfabeto"
sweepingTime.interval = 1
}
else if(palavras.focus)
{
root.state = "MenuPrincipal"
}
}
sweepingTime.interval = root.menuSpeed;
}
MenuButton {
id: alfabeto
width: page.width / 2
height: page.height / 4
borderWidth: 5
borderColor: "black"
text: "Alfabeto"
fontSize: 24
radius: 100
colorFocusUp: "skyblue"
colorFocusDown: "blue"
}
MenuButton {
id: palavras
width: page.width / 2
height: page.height / 4
radius: 100
borderWidth: 5
borderColor: "black"
text: "Palavras"
fontSize: 24
colorFocusUp: "pink"
colorFocusDown: "red"
}
Timer {
id: sweepingTime
interval: 1
running: mainMenuColumn.visible
repeat: true
onTriggered: {
if(alfabeto.focus)
{
palavras.focus = true;
}
else if (palavras.focus)
{
alfabeto.focus = true;
}
else
{
alfabeto.focus = true;
sweepingTime.interval = root.menuSpeed;
}
}
}
}