-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow closing animation to be displayed without showing egui::Window
close button
#4322
Comments
If you create it in the following form and change the is_open_window value, isn't this what you want?
Of course, this is an example, and is_open_window must maintain its value in an external variable or struct. |
|
If
|
Often we can just use the following code, as let mut is_open_window: bool = true;
if is_open_window {
egui::Window::new("test")
.show(ui.ctx(), |ui| {
ui.label("test test test");
});
} But the above code will not show the window closing animation when the window is closed. So I would like to have a |
I'm not sure what the difference is in Please apply #4334, and let us know the results. |
Thanks for the PR, but I have one too, though it seems our PRs don't conflict. |
Because of 'clippy' and 'rust fmt', it is now complete. This is can only turn on/off the |
Because |
Yes, but |
Is your feature request related to a problem? Please describe.
Normally we use
if condition
to control the opening and closing of windows directly, but in this case the window closing animation will not be shown, it will just close.The closing animation is displayed properly only after we call
egui::Window::open
, but the window will have an additional close button. I would like to have control to not show this close button.Describe the solution you'd like
Rename
egui::Window::open
toegui::Window::open_mut
and add a newegui::Window::open
that accepts non-mut reference.In
egui::Window::show_dyn
the close button is shown or not depending on whether the reference is mut or non-mutDescribe alternatives you've considered
None
Additional context
None
The text was updated successfully, but these errors were encountered: