mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-29 04:46:50 -06:00
M8: Keyboard shortcuts panel closes on the home screen (#548)
This commit is contained in:
@@ -1414,6 +1414,8 @@ impl FigApp {
|
||||
return;
|
||||
}
|
||||
if !self.has_files() || self.ui.home {
|
||||
// The shortcuts panel belongs to the canvas; it doesn't hang over the home screen.
|
||||
self.ui.shortcuts_panel = false;
|
||||
tabs::tab_bar(self, ui);
|
||||
home::show(self, ui);
|
||||
dialogs::keys(self, &ctx);
|
||||
|
||||
@@ -188,3 +188,12 @@ fn shortcuts_panel_opens_switches_tabs_and_searches() {
|
||||
u.app.run("help.shortcuts", json!({}));
|
||||
assert!(!u.app.ui.shortcuts_panel, "the command toggles it");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shortcuts_panel_does_not_show_on_the_home_screen() {
|
||||
let mut u = Ui::new(Session::empty());
|
||||
u.app.ui.home = true;
|
||||
u.app.ui.shortcuts_panel = true;
|
||||
u.frame(vec![]);
|
||||
assert!(!u.app.ui.shortcuts_panel, "the panel closes on the home screen");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user