entity layer
This commit is contained in:
30
konstructor/entity/entity.menu.go
Normal file
30
konstructor/entity/entity.menu.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package entity
|
||||
|
||||
import "image/color"
|
||||
|
||||
type MenuMap map[string]Menu
|
||||
|
||||
type MenuLayout struct {
|
||||
Background string
|
||||
MenuItemFont FontLayout
|
||||
}
|
||||
|
||||
type MenuItem struct {
|
||||
ID string
|
||||
Label string
|
||||
Handler func()
|
||||
}
|
||||
|
||||
type Menu struct {
|
||||
CurrentSelected int
|
||||
Layout MenuLayout
|
||||
MenuItems []MenuItem
|
||||
}
|
||||
|
||||
func (menu *Menu) GetMenuItemColor(i int) color.Color {
|
||||
if menu.CurrentSelected == i {
|
||||
return menu.Layout.MenuItemFont.SelectedColor
|
||||
} else {
|
||||
return menu.Layout.MenuItemFont.Color
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user