forked from 1b-agent/opencadstudio-upstream
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 <[email protected]>
This commit is contained in:
1 parent
56a449e5ed
commit
25bf371290
2 files changed
+3
-83
No files matched your search
+3
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user