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

Give controls an opacity #9

Open
tomrijnbeek opened this issue Aug 14, 2019 · 3 comments
Open

Give controls an opacity #9

tomrijnbeek opened this issue Aug 14, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@tomrijnbeek
Copy link
Member

Opacity is a property of a control that I can see recurring quite often. Right now there isn't really any way of making an entire control transparent. You'd have to multiply all the colours with the alpha and somehow not accidentally override that even if you're a few levels down in the control hierarchy.

My suggestion is to add an Opacity property to controls in a similar vain to the Frame. That is, a control can set its own immediate opacity (default = 1), which will then be multiplied by the parent opacity for the final calculated value.

While renderers will still have to keep this value in mind manually, it will at least make sure entire subtrees of controls are made transparent correctly.

@tomrijnbeek
Copy link
Member Author

One thing I was thinking is whether there are going to be other properties of controls beyond Frame and Opacity that exercise the same behaviour, where the evaluated values are dependent on a parent value. If we expect it to be (many) more, we should consider whether there should be a general framework for "propagated properties" like that.

@paulcscharf
Copy link
Member

I don't know if I like including what is a 100% graphical thing in our library which purposefully does not include any rendering code.

@tomrijnbeek
Copy link
Member Author

We already have an IsVisible, which is arguably very rendering-based too, though it does include logic around mouse input I suppose. Opacity is just a continuous variant of visibility, but I can see your point about it being much more of a rendering thing.

Still, properties that propagate like this are something I need right now, so I'd love to find a solution for it. If not by adding the Opacity directly, then somehow else, because I could see these being something we'd want to do more often.

@tomrijnbeek tomrijnbeek added the enhancement New feature or request label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants