-
Notifications
You must be signed in to change notification settings - Fork 15
Suggestions based on current status. #1
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
Comments
On the "view" naming and concept: One thing that led to the use of "sub_view" was an attempt to avoid using parent/child relationship terms. But it turned out inconsistent, because it's still used in some places. It may be worthwhile to use them in the "add" function name to make it more clear and consistent. The specific use of the term "view" came from my background with Android. There is an object I do think we have a need for some higher level object that the rest of our widgets should extend. We could use "view" or a different term ( "Widget" perhaps?) It will have the common properties like If we make a higher level object like that and use it for all widgets moving forward it will make a nice unified API between all of the widgets that allows the user to place them how they want. One thing this unified API will allow us to do build up layout classes like grid layout that will make use of that core set of positioning APIs to do the heavy lifting of arranging views into interesting or useful ways. With regards to child_padding: I need to test it out a bit to be sure but I think the idea is it would add extra space inside the grid cell, but outside the child ( so it would make the cell a little bigger than it needs to be to contain the child). Theoretically this might be one way to help ease the complexities of adding extra things. But I have in mind another solution to the core problem. I am working on a new kind of label that works a bit differently from the existing ones. The new one is going to allow setting it to an arbitrary size and then it will try to fit the text within that. When this component exists how I am thinking I think it should allow you to have much easier control over spacing within the grid without having to add extra children for spaces. Agreed about |
Just a follow up question regarding use of anchor points inside of grid layout. The use of But this seems a little awkward. Also, could there be situations where you want to place widgets specifically based on pixel dimensions rather than on relative dimensions (of the widget and cell sizes)? Just wanted to elicit y’all’s thoughts on handling widget placement issues. |
Now example adafruit#1 displays the temperature in degrees Celsius while example adafruit#2 displays the temperature in degrees Fahrenheit.
@FoamyGuy @kmatch98 Thank you so much for writing this! It made my project much simpler. Here are a few thoughts!
For context, I am currently working with this file.
The project I am using it in can be found here.
In terms of
add_sub_view
:add_sub_view
doesn't make it clear to me what it's doing - the example did that. I do not know, however, from where the name was derived, so it could be adisplayio
thing, in which case proceed as is. Really, I am unclear on what the concept of aview
is - this may be a concept I'm simply unfamiliar with in which case education will resolve the issue. Otherwise, consider a naming change to make things more clear.view
could be clearer. That or we supplement with excellent documentation. :)view_grid_size
should default to(1, 1)
as that seems like a sane default. It would significantly shorten up a basic constructor.In the
GridLayout
constructor:child_padding
could be more clearly named, I had to mess with it to figure out what it did, and I'm still not sure I really know.max_children
could default to the grid sizex
*y
.child_padding
does versus what settingx
andy
do?Feature requests:
These are the things that occurred to me while using the version linked above in a project. I'm sure I'll come up with more as we work through it!
The text was updated successfully, but these errors were encountered: