-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Setting the visibility of UI nodes is confusing and redundant #5368
Copy link
Copy link
Open
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-DocsAn addition or correction to our documentationAn addition or correction to our documentation
Description
What problem does this solve or what need does it fill?
The visibility of UI entities can be controlled in two distinct ways: via the Style component's field, and by setting Visibility (you could also muck with ComputedVisibility but please don't).
This is both confusing, and results in inconsistent behavior (see #5360 and the resulting #5361).
What solution would you like?
Remove the Display field of Style, and let users set this via the Visiblity component instead. In the interface with taffy, construct the taffy::Style struct information based on the combination of these components.
This is simple, allows for direct querying and is much more consistent with the rest of the engine.
What alternative(s) have you considered?
- Use
Displayas the canonical representation. This is confusing, and ties us tightly to CSS's model rather than being modular. It's also very inconsistent with the way visibility is handled elsewhere. - Automatically sync these. This has non-zero computational costs and serious complexity (and bug-risk) costs, for no apparent benefit.
Additional context
Prompted by @mockersf complaining about this in #5361 (comment) <3
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-UIGraphical user interfaces, styles, layouts, and widgetsGraphical user interfaces, styles, layouts, and widgetsC-DocsAn addition or correction to our documentationAn addition or correction to our documentation