Some work

This commit is contained in:
2025-09-25 09:49:52 -05:00
parent dee65c4188
commit d3334d73f6
4 changed files with 306 additions and 19 deletions

View File

@@ -63,8 +63,10 @@ func (w *Button) Init(id string, style tcell.Style) {
w.onPressed = func() bool { return false }
w.focusable = true
}
func (w *Button) Id() string { return w.id }
func (w *Button) HandleResize(ev *tcell.EventResize) { w.w, w.h = ev.Size() }
func (w *Button) Id() string { return w.id }
func (w *Button) HandleResize(ev *tcell.EventResize) {
w.w, w.h = ev.Size()
}
func (w *Button) SetKeyMap(km KeyMap) { w.keyMap = km }
func (w *Button) AddToKeyMap(km KeyMap) { w.keyMap.Merge(km) }
@@ -113,6 +115,7 @@ func (w *Button) Draw(screen tcell.Screen) {
wh.DrawText(w.x, w.y+1, fmt.Sprintf("╰%s╯", strings.Repeat("─", len(lbl)-2)), dStyle, screen)
return
}
if w.w < 2 {
wh.DrawText(w.x, w.y, "╬", dStyle, screen)
return