From eaef4109391e482247df2f5a0deff14da0ea03ab Mon Sep 17 00:00:00 2001 From: Shehriyar Qureshi Date: Tue, 4 Mar 2025 16:54:38 +0500 Subject: [PATCH] fix(app): close preview on single click match on Preview (the type) to close preview context in single click. matching on Preview type prevents the equality check failing b/w ContextPage::Preview(Some,_) and ContextPage::Preview(None,_) --- src/app.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index c99aed4..4e520cc 100644 --- a/src/app.rs +++ b/src/app.rs @@ -3097,7 +3097,9 @@ impl Application for App { } Message::ToggleContextPage(context_page) => { //TODO: ensure context menus are closed - if self.context_page == context_page { + if self.context_page == context_page + || matches!(self.context_page, ContextPage::Preview(_, _)) + { self.set_show_context(!self.core.window.show_context); } else { self.set_show_context(true);