Merge pull request #848 from thatdevsherry/fix/two-clicks-to-close-preview

fix: close selected preview on single click
This commit is contained in:
Jeremy Soller 2025-03-04 08:37:20 -07:00 committed by GitHub
commit 0ab6e49396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);