Replies: 1 comment 10 replies
-
|
@jason-but With regards to your layout issue, I would suggest you write a small MRE that shows your current solution. And possibly a simple diagram to show what you would like to happen. As for your second problem, bindings are shown for focused widgets. If you want your bindings to be active when the widget isn't focused, it belongs on the Screen. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I am developing an Application that acts as a dashboard to monitor the status of all ZPools on a ZFS (file system) enabled system
The dashboard should be a single screen application, with a series of panels for each ZPool on the system
First problem
I have a single class called
ZPool, which represents the status of a single pool, that class has three properties that individually return 3 Rich Tables containing the status for display. Why do I use Rich tables:DataTabledid not suit the layout I wanted to use, I could not get it to look how I wantedI have a class
ZPoolPanel, subclassed fromStatic. This class is supposed to display a single panel to the display. I use threeStatic()widgets (one for each RichTable) contained within aVerticalScrollWidget in case there is not enough screen real-estate.The widget is composed with:
The
_refresh_panel()method sets the contents of the threeStatic()widgets within wherezpool_datais an instance ofZPool:There is a watch on the
zpool_datamember variable so the main application can update the variable to force an update to the display. The watch method also calls_refresh_panel()._refresh_panel()is also called incompose()as at this stage we have the data to display so we do soThe three tables can vary in size depending on the current state of each
ZPool.This panel works fine, I can display it, I can set a timer in the main app to update the
zpool_datavariable and manually refresh. There are no problems with the panelI have a class
Dashboard, subclassed fromApp. This app sets up the main dashboard. Apart from a header and footer, the main screen is aVerticalContainer Widget containing 1 or moreZPoolPanelWidgets for display.The widget is composed with:
The
VerticalWidget is composed as an empty group and stored as a variable so I can add/removeZPoolPanelWidgets as required.There is a
refresh_panels()method that is called either when a timer expires or manually. The contents are not that important, but the method:The app also works fine, Zpools can be added and removed from the system, tasks can be started, and the dashboard continues to display correct, updated, data
My problem lays with the layout on the screen, I cannot get the panels to behave the way I want to with regards to CSS and in particular the space they take on the screen.
All Panels have a CSS style of:
What I would like to happen is:
I expected this to happen when I set the Panel CSS
height = 'auto'. However in this case, each Panel height is set to the screen height, forcing the second and higher indexed panels off the screen where they cannot be seen.If I instead set the Panel CSS
height = '1fr', each panel takes up an even fraction of the screen. This results in panels being too high (not 'just big enough' to show information with no extra space). When there is not enough real-estate, scroll-bars appear in the panels (good), but some panels have too much white space due to the'1fr'setting and reduce the amount of status that can be seen in other panelsNow that I've explained all this, what do I need to change/set in the CSS (or in the code) to achieve the layout I wish to see?
Second problem
As a secondary problem, I am not sure if there is a problem with the
Footer()Widget. I have two key bindings ("up" and "down") mapped to increase and decrease the dashboard refresh period. When I run the application, these bindings appear on the footer with nice directional arrows as guides. This is what I expected.However, as soon as I use the mouse to click into the app, or I select the ^p palette command, the
Footergets re-arranged and the ("up" and "down") key bindings are no longer displayed. The keys/bindings still work (if I press the up/down arrows), however the instructions no longer appear on theFooter(). All other key-bindings are still displayed on the footerThank you in advance
Jason
Beta Was this translation helpful? Give feedback.
All reactions