mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-24 10:46:50 -06:00
Chrome: turning the File tab off closes a Backstage that is already open
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9b8fde71ee
commit
92c0d1e936
@@ -1129,6 +1129,10 @@ impl SheetApp {
|
||||
// The language the widgets translate with this frame (see `i18n::current`).
|
||||
i18n::set_current(&ctx, self.ui.language);
|
||||
let t = theme::Tokens::get(&ctx);
|
||||
// A host can turn the File tab off while Backstage is already open: close it.
|
||||
if !self.chrome.file_tab {
|
||||
self.backstage = None;
|
||||
}
|
||||
if self.backstage.is_none() {
|
||||
self.ribbon_keys(&ctx);
|
||||
}
|
||||
|
||||
@@ -52,3 +52,14 @@ fn without_the_file_tab_the_backstage_view_never_opens() {
|
||||
assert!(h.state().backstage.is_none(), "so is every page, Print and Save As included");
|
||||
assert!(h.query_by_label("AutoSave").is_some(), "the title bar can stay on its own");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn turning_the_file_tab_off_closes_an_open_backstage() {
|
||||
let mut h = harness(Chrome::default());
|
||||
h.state_mut().open_backstage(Page::Home);
|
||||
h.run_steps(3);
|
||||
assert!(h.state().backstage.is_some(), "Backstage opens with the File tab on");
|
||||
h.state_mut().chrome.file_tab = false;
|
||||
h.run_steps(3);
|
||||
assert!(h.state().backstage.is_none(), "and closes when the host turns the File tab off");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user