-
Notifications
You must be signed in to change notification settings - Fork 0
/
navigation_ms.go
73 lines (70 loc) · 1.81 KB
/
navigation_ms.go
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
package main
// Navigation on the main screen
func NavToNext() bool {
if itemsList.HasFocus() {
mainSetFocus(fieldsList)
return true
} else if fieldsList.HasFocus() {
mainSetFocus(tagsFilter)
return true
} else if tagsFilter.HasFocus() {
mainSetFocus(searchInput)
return true
} else if searchInput.HasFocus() {
mainSetFocus(buttonLock)
return true
} else if buttonLock.HasFocus() {
app.SetRoot(wrapperFlex, true).SetFocus(buttonAddItem)
return true
} else if buttonAddItem.HasFocus() {
app.SetRoot(wrapperFlex, true).SetFocus(buttonAddField)
return true
} else if buttonAddField.HasFocus() {
app.SetRoot(wrapperFlex, true).SetFocus(buttonSettings)
return true
} else if buttonSettings.HasFocus() {
app.SetRoot(wrapperFlex, true).SetFocus(buttonAbout)
return true
} else if buttonAbout.HasFocus() {
app.SetRoot(wrapperFlex, true).SetFocus(buttonQuit)
return true
} else if buttonQuit.HasFocus() {
app.SetRoot(wrapperFlex, true).SetFocus(itemsList)
return true
}
return false
}
func NavToPrevious() bool {
if itemsList.HasFocus() {
mainSetFocus(buttonQuit)
return true
} else if fieldsList.HasFocus() {
mainSetFocus(itemsList)
return true
} else if tagsFilter.HasFocus() {
mainSetFocus(fieldsList)
return true
} else if searchInput.HasFocus() {
mainSetFocus(tagsFilter)
return true
} else if buttonLock.HasFocus() {
mainSetFocus(searchInput)
return true
} else if buttonAddItem.HasFocus() {
mainSetFocus(buttonLock)
return true
} else if buttonAddField.HasFocus() {
mainSetFocus(buttonAddItem)
return true
} else if buttonSettings.HasFocus() {
mainSetFocus(buttonAddField)
return true
} else if buttonAbout.HasFocus() {
mainSetFocus(buttonSettings)
return true
} else if buttonQuit.HasFocus() {
mainSetFocus(buttonAbout)
return true
}
return false
}