fix(menu): close the main menu when opening a recent file
The recent-file buttons dispatched the open command without closing the app menu, so it stayed open over the loaded drawing. Use CloseAppMenuAndRun so the menu closes first, matching the other menu entries. Also commits the Cargo.lock update from dropping iced's debug feature. Fixes #103. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
56a449e5ed
commit
25bf371290
2 changed files with 3 additions and 83 deletions
|
|
@ -396,7 +396,9 @@ fn recent_item_btn(path: &PathBuf) -> Element<'_, Message> {
|
|||
.align_y(iced::Center)
|
||||
.spacing(6),
|
||||
)
|
||||
.on_press(Message::Command(format!("OPEN_RECENT:{path_str}")))
|
||||
.on_press(Message::CloseAppMenuAndRun(format!(
|
||||
"OPEN_RECENT:{path_str}"
|
||||
)))
|
||||
.style(|_: &Theme, status| button::Style {
|
||||
background: Some(Background::Color(match status {
|
||||
button::Status::Hovered => ITEM_HOVER,
|
||||
|
|
|
|||
Loading…
Reference in a new issue