1
0
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:
Chris Cummer
2018-05-03 15:49:06 -07:00
parent 53d2fdacda
commit 351f5100bc
2 changed files with 67 additions and 33 deletions

29
wtf/billboard_modal.go Normal file
View 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
}