From 0a2b9c483efaa008788605456b07ec2f984c5ab2 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Mon, 20 Jan 2020 20:29:45 +0000 Subject: [PATCH] fix: limit the height and width of flex This commit fixes the issue where the app was using the full height of the terminal screen. The fix include setting the 'fullscreen' boolean to false and explicity defining the size using SetRect. --- main.go | 2 +- ui.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c842166..8d6a49e 100644 --- a/main.go +++ b/main.go @@ -84,7 +84,7 @@ func main() { flex := newFlex(infoUI, timerUI) go pominal.Run(infoUI, timerUI) - if err := app.SetRoot(flex, true).SetFocus(flex).Run(); err != nil { + if err := app.SetRoot(flex, false).SetFocus(flex).Run(); err != nil { panic(err) } } diff --git a/ui.go b/ui.go index bbac8a4..ba2812e 100644 --- a/ui.go +++ b/ui.go @@ -44,6 +44,7 @@ func newTimerUI(app *tview.Application) *tview.TextView { func newFlex(info, timer *tview.TextView) *tview.Flex { f := tview.NewFlex().AddItem(info, 30, 1, false).AddItem(timer, 50, 1, false) + f.SetRect(0, 0, 80, 20) return f }