Fix animation of collapsing windows
This commit is contained in:
parent
3737067994
commit
84099b24c9
1 changed files with 8 additions and 7 deletions
|
@ -136,6 +136,10 @@ impl<'open> Window<'open> {
|
|||
scroll,
|
||||
} = self;
|
||||
|
||||
if matches!(open, Some(false)) {
|
||||
return None;
|
||||
}
|
||||
|
||||
let movable = area.is_movable();
|
||||
let area = area.movable(false); // We move it manually
|
||||
let resizable = resize.is_resizable();
|
||||
|
@ -148,10 +152,6 @@ impl<'open> Window<'open> {
|
|||
|
||||
let resize = resize.id(resize_id);
|
||||
|
||||
if matches!(open, Some(false)) {
|
||||
return None;
|
||||
}
|
||||
|
||||
let frame = frame.unwrap_or_else(|| Frame::window(&ctx.style()));
|
||||
|
||||
let full_interact = area.show(ctx, |ui| {
|
||||
|
@ -170,9 +170,6 @@ impl<'open> Window<'open> {
|
|||
collapsing_id,
|
||||
&mut collapsing,
|
||||
);
|
||||
ui.memory()
|
||||
.collapsing_headers
|
||||
.insert(collapsing_id, collapsing);
|
||||
|
||||
// TODO: fix collapsing window animation
|
||||
let content = collapsing.add_contents(ui, |ui| {
|
||||
|
@ -186,6 +183,10 @@ impl<'open> Window<'open> {
|
|||
})
|
||||
});
|
||||
|
||||
ui.memory()
|
||||
.collapsing_headers
|
||||
.insert(collapsing_id, collapsing);
|
||||
|
||||
if let Some(open) = open {
|
||||
// Add close button now that we know our full width:
|
||||
|
||||
|
|
Loading…
Reference in a new issue