From 9bd78c648bca6f68ef94c114f7b252879a5ec6b6 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Sat, 13 Jan 2024 05:55:07 -0800 Subject: [PATCH] Switcher now unmounts This isn't quite perfect, as a Switcher shared with multiple windows will only unmount in one window. --- src/widgets/switcher.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/switcher.rs b/src/widgets/switcher.rs index daaaf06..dc757d9 100644 --- a/src/widgets/switcher.rs +++ b/src/widgets/switcher.rs @@ -55,6 +55,7 @@ impl WrapperWidget for Switcher { context: &mut LayoutContext<'_, '_, '_, '_>, ) -> Size { if self.source.has_updated() { + self.child.unmount_in(context); self.child = WidgetRef::new(self.source.get()); } context.invalidate_when_changed(&self.source);