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

Fix 4193 - set hidden_by_parent when adding to displayio group #4915

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

Neradoc
Copy link

@Neradoc Neradoc commented Jun 24, 2021

Fixes #4193 using the proposed simple solution.

When appending a layer (Group or TileGrid) to a displayio group, set the hidden_by_parent attribute to true if the group (the new "parent") is either hidden or hidden_by_parent. The *_set_hidden_by_parent functions propagate the value further down the tree as necessary.

This fixes in particular updating text labels while they are hidden, like you would with a pagination system, since it involves inserting one or more TileGrids inside the label's Group, triggering the issue.

Tested on the Clue with the code from the issue and some test code updating text labels while hidden.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@tannewt tannewt merged commit 57f898b into adafruit:main Jun 24, 2021
@Neradoc Neradoc deleted the fix-4193 branch September 4, 2021 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

displayio.Group .hidden flag is not honored if set to True before content is appended to group.
2 participants