mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #81] Forms should grow underlying box's size #62
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joegrasse on GitHub (Mar 15, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/81
From what I can tell, a Form is based off of a base Box. A base box has a size of w:15 h:10. Unless you draw a Form full size, the size of the form will be the base box size. It would be nice if the form would grow the base box size. This is so that you don't have to specifically set the Forms size, if you don't want it full screen.
Example:
@rivo commented on GitHub (Mar 15, 2018):
Boxpositions/sizes (and therefore the positions of all primitives) are always specified top-down. This is not like HTML/CSS where the content size of an element is measured and can propagate up the hierarchy. I'm not planning on implementing a browser-like layout engine. This is quite complicated and will add tremendous complexity totview(while breaking backwards compatibility).You can set the second
SetRoot()argument totrueto use the entire screen. Alternatively, there isFlexandGridwhich will adapt to screen size. I know that this requires you to estimate the size of your form yourself but in most cases, this should not be a problem.