-
Notifications
You must be signed in to change notification settings - Fork 15
Main classes: Widget
and Control
#5
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
Conversation
…, includes horizontal switch widget definition and PyPortal example
… _get_offset_position, add label positioning parameters
…d supporting fonts
…, includes horizontal switch widget definition and PyPortal example
…, includes horizontal switch widget definition and PyPortal example
This is ready fo review. I have simplified the earlier draft PR by just pulling out the main class definitions for Main objective of this review is to get feedback on the class definitions and whether these two classes have the right structure to accommodate an assortment of future graphical widgets, including those with touch response. Some lingering questions to spur discussion:
Thanks for your input! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are looking pretty good to me. I noticed a few docstrings that need tweaked, and I had a few other questions.
I can share my thoughts on the questions you asked as well:
Q1: I think I am in favor of making them blocking and not having the user rely on calling an update or animate function in their main loop. The animation should be taking too long (though that depends a lot on the use case as well). And I think it's better to block so that it can complete uninterrupted. If user needs no block they could set animation time to 0.
Q2: I think I lean towards no name
by default even though it would make some use cases a little easier. It's not a super strong opinion though, I'm open to other thoughts on this. If we do build it in to widget I think it would be best if it can be done in such a way that if the user is not using it then they can still use their widget without needing display_text library on their device (assuming they aren't otherwise using it.)
Q3: for the short / medium term I think this set that you have is good. If anything I might be in favor of removing a few until we get a more fleshed out event system in place. I'd maybe get rid of gesture_response
, released
, and still_touched
. They could get added back in once we have something specific that is using them.
It's definitely a larger discussion than for this PR, but in the longer term I wonder if there is any opportunity for a core module to interact with a touch screen "in the background" and cache events for us waiting until the user code checks for them. Similar to how displayio renders in the background, and gamepad manages button state in the background.
…ing graphic, update Sphinx api.rst definitons
…tation and updated api.rst
I made major updates to the documentation and was able to build them on my machine. However, the checks failed here due to Pylint. It's complaining about repeated code use in the examples folder. Strange. I suspect this is due to some unknown changes in the pylint settings. @kattni will look into this and see if there is a way around it. Please wait until that is resolved before spending any time on this, since the documentation is probably the biggest change added in the latest commits. Let's give it a few days to get resolved and then can review once the docs are built. |
Update on Q1 above. There are asynchronous (async) features that have been added recently:
This can come in handy for the widget redraw functions and the touch response handler. But for now let’s keep the redraw code as blocking, and explore this async capability in the future. |
Thanks to the recent pylint fixes, this is now passing. @FoamyGuy I'd appreciate if you would take a quick look to verify I addressed your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are looking great to me after the latest changes. Thank you! I think this is ready to merge any time. Let me know if there is anything you know of we need to hold back for @kmatch98. If not i'll be back this evening to merge this.
This PR adds the primary main classes that define the baseline structure of the
Widget
andControl
classes.The main discussion related to the structure is located in this issue.