tui/modals/modal_info.go

30 lines
533 B
Go
Raw Permalink Normal View History

2023-04-24 11:41:38 +02:00
package modals
import (
2023-04-24 11:55:04 +02:00
"git.milar.in/milarin/tui/views"
2023-04-24 11:41:38 +02:00
)
type InfoModal struct {
*views.FrameView
}
func NewInfoModal(message string) *InfoModal {
tv := views.NewTextView(message)
bv := views.NewBorderView(views.NewMarginView(tv, 0, 1, 0, 1))
fv := views.NewFrameView(bv)
fv.DontClearBuffer = true
m := &InfoModal{
FrameView: fv,
}
2023-04-24 11:55:04 +02:00
// m.KeyPressed = func(event *tui.KeyEvent) (consumed bool) {
// // if event.Key() == tcell.KeyEnter || event.Key() == tcell.KeyESC {
2023-04-24 11:41:38 +02:00
2023-04-24 11:55:04 +02:00
// // }
// return true
// }
2023-04-24 11:41:38 +02:00
return m
}