Switcher now unmounts

This isn't quite perfect, as a Switcher shared with multiple windows
will only unmount in one window.
This commit is contained in:
Jonathan Johnson 2024-01-13 05:55:07 -08:00
parent 02e90e48c6
commit 9bd78c648b
No known key found for this signature in database
GPG key ID: A66D6A34D6620579

View file

@ -55,6 +55,7 @@ impl WrapperWidget for Switcher {
context: &mut LayoutContext<'_, '_, '_, '_>,
) -> Size<ConstraintLimit> {
if self.source.has_updated() {
self.child.unmount_in(context);
self.child = WidgetRef::new(self.source.get());
}
context.invalidate_when_changed(&self.source);