ElyTable: closing a tab closes its dialog too (T-11)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 19:12:08 -04:00
1 parent 345e248ff7
commit 759d84e20b
6 files changed
+66 -2

No files matched your search

+11
View File
@@ -101,6 +101,17 @@ impl Host for Book {
self.sync_bars(view, cx);
}
}
/// A closed tab's dialog and list go with it.
fn tab_closed(&mut self, tab: &ely_office::Tab<Extra, ely_office::Lok>, cx: &mut Context<Self>) {
if self.dialog.as_ref().and_then(crate::dialog::Dialog::tab) == Some(tab.id) {
self.dialog = None;
}
if self.choices.as_ref().is_some_and(|choices| choices.tab == tab.id) {
self.choices = None;
}
cx.notify();
}
}
/// The window root with a blank workbook.