Skip to content

Commit

Permalink
fix: close context menu when switching pages
Browse files Browse the repository at this point in the history
Signed-off-by: Dusan <dusanuveric@protonmail.com>
  • Loading branch information
uvera authored and mmstick committed Feb 10, 2025
1 parent 6fea8dc commit bdf9e6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cosmic-settings/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,11 @@ impl SettingsApp {
self.active_page = page;

let mut leave_task = iced::Task::none();
let mut close_context_drawer_task = iced::Task::none();

if current_page != page {
self.loaded_pages.remove(&current_page);
close_context_drawer_task = cosmic::task::message(Message::CloseContextDrawer);
leave_task = self
.pages
.on_leave(current_page)
Expand Down Expand Up @@ -850,6 +852,7 @@ impl SettingsApp {
Task::batch(vec![
leave_task,
page_task,
close_context_drawer_task,
cosmic::task::future(async { Message::SetWindowTitle }),
])
}
Expand Down

0 comments on commit bdf9e6a

Please sign in to comment.