mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 14:49:06 -04:00
Smoother CollapsingHeader animation (#8177)
Animate the spacing between the header and the body. It's subtle, but looks slightly nicer when closing a panel.
This commit is contained in:
@@ -189,6 +189,8 @@ impl CollapsingState {
|
||||
self.store(ui.ctx()); // we store any earlier toggling as promised in the docstring
|
||||
None
|
||||
} else if openness < 1.0 {
|
||||
ui.add_space((openness - 1.0) * ui.spacing().item_spacing.y); // animate spacing too
|
||||
|
||||
Some(ui.scope_builder(builder, |child_ui| {
|
||||
let max_height = if self.state.open && self.state.open_height.is_none() {
|
||||
// First frame of expansion.
|
||||
|
||||
Reference in New Issue
Block a user