2021-12-22 11:17:18 -07:00
|
|
|
package ui
|
|
|
|
|
2021-12-24 03:07:21 -07:00
|
|
|
// The Focus Map Helps to keep track of which UI Element Currently Has the Focus It can be queried to get the Current
|
|
|
|
// UI Element with Focus and also can set UI Focus keep in mind that it isn't Focus Map that is Responsible to change
|
|
|
|
// the Focus that is Done through the Update Function of UI.ExpandedView */
|
2021-12-22 11:17:18 -07:00
|
|
|
var FocusMap map[string]bool
|
|
|
|
|
|
|
|
func GenerateFocusMap() {
|
|
|
|
FocusMap = make(map[string]bool)
|
|
|
|
FocusMap["Playlist"] = true
|
|
|
|
FocusMap["FileBrowser"] = false
|
|
|
|
FocusMap["SearchView"] = false
|
2021-12-25 11:48:23 -07:00
|
|
|
FocusMap["BuffSearchView"] = false
|
2021-12-22 11:17:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func HasFocus(s string) bool {
|
|
|
|
return FocusMap[s]
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetFocus(s string) {
|
|
|
|
for k := range FocusMap {
|
|
|
|
FocusMap[k] = false
|
|
|
|
}
|
|
|
|
FocusMap[s] = true
|
|
|
|
}
|