-
-
Notifications
You must be signed in to change notification settings - Fork 124
first 8 rows in the table have large line-height #71
Comments
Line 36 in be6863e
I wonder if this is intended. |
It is a consequence of the layout algorithm used in tui-go (which is the same as in the Qt project). Widgets in a Box fight for the space, and unless one of the widgets have the Expanding size policy, they will share the space equally. In a graphical application (with Qt) this isn't as big of an issue since pixels are smaller units of space. The solution is probably to make the top or bottom widget expand:
... or, to add a Let me know if it works for you! |
I added a bottom spacer widget to the vbox that has the table. Strangely this does not shrink the table height. And setting size policy also does not work too. |
That should work though, so it might be a bug after all :) Do you think you could post an example with the problem? Thanks! |
Here is a minimum example. It turns out that I have a no-break space in my text 🍰 . package main
import (
tui "github.com/marcusolsson/tui-go"
)
func main() {
table := tui.NewTable(0, 0)
for i := 0; i < 3; i++ {
table.AppendRow(
tui.NewLabel("test\u00a0test"),
)
}
container := tui.NewVBox(table, tui.NewSpacer())
container.SetBorder(true)
container.SetSizePolicy(tui.Expanding, tui.Expanding)
ui := tui.New(container)
ui.SetKeybinding("Esc", func() { ui.Quit() })
ui.Run()
} |
Confirming this as a bug. The spacer should claim the extra space from the table rows. |
The text was updated successfully, but these errors were encountered: