-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
No lightweight way to adjust ui style #17
Labels
good first issue
Good for newcomers
Comments
Good point! I think allowing |
Merged
Great! PR submitted. After submitting the initial comment, I noticed the same thing about ui.layout. The PR includes both changes. Sorry if that's bad form. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I could be wrong about the following. I'm just starting to learn Rust, so I could have misunderstood something. I believe this is the only way to change style elements given the current API:
The
ui
'sstyle
member is private and theui.style()
method returns an immutable reference. So the only way to change a single style element is to clone the whole struct out, make the change, and pass ownership back into theui
. This is awkward to implement, and forces needless copies. It's also redundant with the clone that happens when a child ui is created. Touching a given ui's style won't affect global style settings.The patterns in the
Style::ui
widget hints that some kind of public access is safe and may have been intended, but I can't find a pathway for it.The text was updated successfully, but these errors were encountered: