fix(app): close selected preview on single click
set context_page to preview with Some(entity) instead of None when "Show details" is selected. Preview of None entity would fail first equality check in Message::ToggleContextPage as `Preview(None, ..) != Preview(Some, ..)` . This fixes the two clicks needed to close Preview of Selected as first click would update self.context_page from Preview(None,..) to Preview(Some,..) and next click would pass equality and close Preview.
This commit is contained in:
parent
c8aa80fb2f
commit
b25d0b5ff7
1 changed files with 1 additions and 1 deletions
|
|
@ -2704,7 +2704,7 @@ impl Application for App {
|
||||||
match self.mode {
|
match self.mode {
|
||||||
Mode::App => {
|
Mode::App => {
|
||||||
let show_details = !self.config.show_details;
|
let show_details = !self.config.show_details;
|
||||||
self.context_page = ContextPage::Preview(None, PreviewKind::Selected);
|
self.context_page = ContextPage::Preview(entity_opt, PreviewKind::Selected);
|
||||||
self.core.window.show_context = show_details;
|
self.core.window.show_context = show_details;
|
||||||
return cosmic::task::message(Message::SetShowDetails(show_details));
|
return cosmic::task::message(Message::SetShowDetails(show_details));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue