Regression in visuals scoping: ui.set_visuals affects entire app since v0.34.1 #8039
Unanswered
itsNiccoloSabatini
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
After upgrading to egui 0.34.1, I am unable to maintain two different visual styles (e.g., a blue sidebar and a white main panel) within the same frame. Even when wrapping the style changes inside a ui.scope or ui.child_ui, the last call to a visuals-changing function seems to "leak" or override the global context, causing the entire application to adopt the last defined style.
In previous versions, I could successfully isolate these styles.
To Reproduce
I am using a pattern similar to this but separated in different modules
mainpanel.rsandmenu.rs(called in ordermenu.rsfirst andmainpanel.rsas last) in the 0.34.1:and I was using this method in 0.33.3, although the set visual is outside the designated UI I was still able to isolate the color change to the panel I wanted:
Expected behavior
The SidePanel should remain blue and the CentralPanel should remain white. Instead, the entire app (including the sidebar) turns white because the CentralPanel logic runs last.
Environment
Additional context
It seems that ui.style_mut().visuals or ctx.set_visuals() is no longer strictly scoped when called inside panels or scopes, or there is a conflict in how panel_fill is inherited during the layout pass.
Beta Was this translation helpful? Give feedback.
All reactions