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.
This commit is contained in:
parent
1d79a4c7e6
commit
0a2b9c483e
2 changed files with 2 additions and 1 deletions
2
main.go
2
main.go
|
@ -84,7 +84,7 @@ func main() {
|
||||||
flex := newFlex(infoUI, timerUI)
|
flex := newFlex(infoUI, timerUI)
|
||||||
|
|
||||||
go pominal.Run(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)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
ui.go
1
ui.go
|
@ -44,6 +44,7 @@ func newTimerUI(app *tview.Application) *tview.TextView {
|
||||||
|
|
||||||
func newFlex(info, timer *tview.TextView) *tview.Flex {
|
func newFlex(info, timer *tview.TextView) *tview.Flex {
|
||||||
f := tview.NewFlex().AddItem(info, 30, 1, false).AddItem(timer, 50, 1, false)
|
f := tview.NewFlex().AddItem(info, 30, 1, false).AddItem(timer, 50, 1, false)
|
||||||
|
f.SetRect(0, 0, 80, 20)
|
||||||
|
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue