Skip to content
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

refactor: HeadlessWidget is not a singleton anymore, config migrated to config module #9

Merged
merged 3 commits into from
Mar 9, 2024

Conversation

sassanh
Copy link
Owner

@sassanh sassanh commented Feb 19, 2024

It is now possible to have multiple HeadlessWidget instances in the same app. The config module is now the source of truth for the config, and the HeadlessWidget class is now a regular Kivy widget. The setup_headless_kivy function is now responsible for initializing the display and the config.

It makes it easier to write tests for software that uses HeadlessWidget.
It is also a step towards having display only redraw the parts of the screen that have changed.

@sassanh sassanh changed the title refactor: HeadlessWidget is not a singleton anymore, config module is now source of truth for config refactor: HeadlessWidget is not a singleton anymore, config migrated to config module Feb 19, 2024
…d to config module

refactor: initializing display and config is now done in `setup_headless_kivy`
feat: class method `get_instance` to get the closest parent instance of type `HeadlessWidget`
Copy link
Collaborator

@mehrdadfeller mehrdadfeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Please merge

@sassanh sassanh merged commit 411dfe9 into main Mar 9, 2024
18 checks passed
@sassanh sassanh deleted the refactor branch March 9, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants