|
@@ -4,6 +4,10 @@
|
|
|
|
|
|
|
|
package gui
|
|
package gui
|
|
|
|
|
|
|
|
|
|
+import (
|
|
|
|
|
+ "github.com/g3n/engine/math32"
|
|
|
|
|
+)
|
|
|
|
|
+
|
|
|
type MenuBar struct {
|
|
type MenuBar struct {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -12,6 +16,15 @@ type Menu struct {
|
|
|
items []*MenuItem // menu items
|
|
items []*MenuItem // menu items
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// Menu style
|
|
|
|
|
+type MenuStyle struct {
|
|
|
|
|
+ Border BorderSizes
|
|
|
|
|
+ Paddings BorderSizes
|
|
|
|
|
+ BorderColor math32.Color4
|
|
|
|
|
+ BgColor math32.Color4
|
|
|
|
|
+ FgColor math32.Color4
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
type MenuItem struct {
|
|
type MenuItem struct {
|
|
|
Panel // embedded panel
|
|
Panel // embedded panel
|
|
|
label *Label // optional internal label (nil for separators)
|
|
label *Label // optional internal label (nil for separators)
|
|
@@ -28,6 +41,9 @@ type MenuItem struct {
|
|
|
func NewMenu() *Menu {
|
|
func NewMenu() *Menu {
|
|
|
|
|
|
|
|
m := new(Menu)
|
|
m := new(Menu)
|
|
|
|
|
+
|
|
|
|
|
+ // Initializes the panel
|
|
|
|
|
+ m.Panel.Initialize(0, 0)
|
|
|
m.items = make([]*MenuItem, 0)
|
|
m.items = make([]*MenuItem, 0)
|
|
|
return m
|
|
return m
|
|
|
}
|
|
}
|