-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geometry management questions #24
Comments
Of course it considers that, in a very specific and obvious way, from the README:
|
Yes, the README considers that, but that actual code does not. Is this something you would accept if I can get it working? |
README explicitly states that it's outside of picotui's scope. Geometry management can be implemented on top of picotui using separate libraries. Feel free to keep this issue open and discuss the matter with other interested picotui users. (I personally won't be interested in it until I find a usecase for it. In the meantime, there're much more mundane issues to resolve like #13 or #23). |
The functions above work almost perfectly for this. Some additional math is required when text and frames are involved tho. When using ax for a widget width, it would be something like ax(30)-2. Same goes if you have text on the side of the widget, but the minus would be the length of the label. |
When assigning coordinates to widgets, picotui does not consider that some consoles will be different sizes. So when the application is executed on a different size terminal than it was written for, the widgets may be off-screen, wrap, or there may be extra padding.
Here is my current idea on how to fix this.
Define some functions like this
191x52 is the console size on my main desktop. By wrapping each coordinate with these functions it should adjust the placement of the widgets depending on the screen size.
Something like this would be beneficial in the library.
I am thinking it could work like this.
Create a variable in Screen which hold a virtual screen, vscreen_size? The user than sets vscreen_size when writing their code and uses those coordinates to place widgets.
Now in the widgets, when x, y, height, weight, etc. is set, it wraps the given coordinates in these new functions (could probably be a single function, as a tuple?) in each widget.
This would remove the need for constant dividing in a user's application to place the widgets in the same proportional location when screen size is different than what is being developed on.
The text was updated successfully, but these errors were encountered: