Buffers ?!
This commit is contained in:
@@ -167,13 +167,21 @@ func (w *MenuItem) Draw(screen tcell.Screen) {
|
||||
wh.DrawText(w.x, y, fmt.Sprintf("╯%s╰", strings.Repeat(" ", len(w.label))), w.style, screen)
|
||||
x += 1
|
||||
y += 1
|
||||
// pos := w.GetPos()
|
||||
for i := range w.items {
|
||||
// TODO: Use DrawOffset
|
||||
// pos.DrawOffset(w.items[i], screen)
|
||||
w.items[i].SetPos(Coord{X: x, Y: y})
|
||||
w.items[i].Draw(screen)
|
||||
y++
|
||||
if len(w.items) > 0 {
|
||||
if w.menuType == MenuTypeH {
|
||||
for i := range w.items {
|
||||
w.items[i].SetPos(Coord{X: x, Y: y})
|
||||
w.items[i].Draw(screen)
|
||||
y++
|
||||
}
|
||||
} else {
|
||||
for i := range w.items {
|
||||
ix := x + w.w
|
||||
w.items[i].SetPos(Coord{X: ix, Y: y})
|
||||
w.items[i].Draw(screen)
|
||||
y++
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
screen.SetContent(x, y, ' ', nil, st)
|
||||
@@ -326,3 +334,5 @@ func (w *MenuItem) FindItem(id string) *MenuItem {
|
||||
|
||||
func (w *MenuItem) SetHotKey(r rune) { w.hotKey = r }
|
||||
func (w *MenuItem) GetHotKey() rune { return w.hotKey }
|
||||
|
||||
func (w *MenuItem) SetMenuType(t MenuType) { w.menuType = t }
|
||||
|
||||
Reference in New Issue
Block a user