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

dnd_drop_zone changes style of widget even when nothing is being dragged #5695

Open
JoshMcguigan opened this issue Feb 8, 2025 · 0 comments
Labels
bug Something is broken

Comments

@JoshMcguigan
Copy link

Describe the bug

Drawing a widget within dnd_drop_zone draws a frame of the color defined in ui.visuals.widgets.inactive.bg_fill over the widget. This means a widget drawn in a drop zone looks different from a widget that is not in a drop zone.

I do think its desirable for the drop zone to be highlighted when active, but I don't think it should be highlighted when nothing is being dragged.

https://docs.rs/egui/0.30.0/src/egui/ui.rs.html#2832

^ This line ultimately leads to the inactive style being applied if nothing is being dragged.

Expected behavior

I expect a widget drawn inside of a drop zone look the same as a widget drawn not inside of a drop zone, until something is being dragged.

Additional context

I was able to work around this by setting the inactive.bg_fill to transparent, as in ui.visuals_mut().widgets.inactive.bg_fill = egui::Color32::TRANSPARENT;, but this is not a good solution because the docs say bg_fill should not be set to TRANSPARENT and also because other parts of the UI may have a valid use for inactive.bg_fill which I'd be breaking.

@JoshMcguigan JoshMcguigan added the bug Something is broken label Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant