mum4k / termdash

Terminal based dashboard.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Border title for a group of Widgets

flaviostutz opened this issue · comments

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

image

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.

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?

I used the binary tree layout and all went well! Thanks!

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.