mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-27 03:15:55 +03:00
[GH-ISSUE #240] Border title for a group of Widgets #130
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#130
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 @flaviostutz on GitHub (Jul 28, 2020).
Original GitHub issue: https://github.com/mum4k/termdash/issues/240
In our application we needed a way to group a bunch of widgets by a border title.
Is there a way to do this? How would I implement this feature in termdash?
Something like
@mum4k commented on GitHub (Jul 28, 2020):
Hello @flaviostutz, the way to do this in Termdash is to create a hierarchy of containers.
Create a top container with border. The top container will be the only one with a border.
Split the top container horizontally into two sub-containers.
Split each sub-container vertically into two sub-containers.
Place the widgets into the inner four subcontainers.
Splitting of containers to achieve layout is described in the wiki:
https://github.com/mum4k/termdash/wiki/Binary-tree-layout
Please let me know if you have any further questions.
@flaviostutz commented on GitHub (Jul 28, 2020):
Thanks for the reply! I was searching exactly for this!
The example in the link you mentioned uses the "split" API. Do this works with "grid.RowHeightPerc" API too?
@flaviostutz commented on GitHub (Jul 29, 2020):
I used the binary tree layout and all went well! Thanks!
@mum4k commented on GitHub (Jul 29, 2020):
Glad to hear it worked out, the grid layout is just a different abstraction and essentially achieves the same result. It may be a bit more complicated to achieve this with the grid layout, since the grid layout abstracts the intermediate containers and we need to set a border on one of them here.
The binary layout may be the best option to achieve this behavior.