mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Closer to having a help modal. Text is showing onscreen (badly)
This commit is contained in:
29
wtf/billboard_modal.go
Normal file
29
wtf/billboard_modal.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package wtf
|
||||
|
||||
import (
|
||||
"github.com/gdamore/tcell"
|
||||
"github.com/rivo/tview"
|
||||
)
|
||||
|
||||
func NewBillboardModal(text string) *tview.Frame {
|
||||
textView := tview.NewTextView()
|
||||
textView.SetWrap(true)
|
||||
textView.SetText(text)
|
||||
|
||||
textView.SetBackgroundColor(tview.Styles.ContrastBackgroundColor)
|
||||
|
||||
thing := tview.NewFrame(textView)
|
||||
|
||||
drawFunc := func(screen tcell.Screen, x, y, width, height int) (int, int, int, int) {
|
||||
w, h := screen.Size()
|
||||
thing.SetRect((w/2)-40, (h/2)-11, 80, 22)
|
||||
return x, y, width, height
|
||||
}
|
||||
|
||||
thing.SetBackgroundColor(tview.Styles.ContrastBackgroundColor)
|
||||
thing.SetBorder(true)
|
||||
thing.SetBorders(1, 1, 0, 0, 1, 1)
|
||||
thing.SetDrawFunc(drawFunc)
|
||||
|
||||
return thing
|
||||
}
|
||||
Reference in New Issue
Block a user