diff --git a/src/app/commands.rs b/src/app/commands.rs index ca7aa51cf..e929eca7b 100644 --- a/src/app/commands.rs +++ b/src/app/commands.rs @@ -7,6 +7,9 @@ use std::path::PathBuf; impl OpenCADStudio { pub(super) fn dispatch_command(&mut self, cmd: &str) -> Task { let i = self.active_tab; + // Starting a command closes any open ribbon dropdown (e.g. a style + // combo left open) so it does not stay stuck behind the new tool. + self.ribbon.close_dropdown(); // Cancel any running command before starting a new one. if self.tabs[i].active_cmd.is_some() { self.tabs[i].scene.clear_preview_wire(); diff --git a/src/app/update.rs b/src/app/update.rs index 95c217f0e..2e192c8b3 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -2297,6 +2297,10 @@ impl OpenCADStudio { Message::ViewportLeftPress => { let i = self.active_tab; + // A click in the viewport dismisses any open ribbon dropdown + // (e.g. the annotation style combo), which has no backdrop of + // its own to catch outside clicks. + self.ribbon.close_dropdown(); // Click anywhere outside the popup dismisses it. The // menu's own buttons live above this mouse_area, so a // press that reaches here means the cursor is not on @@ -3062,6 +3066,7 @@ impl OpenCADStudio { Message::ViewportRightPress => { let i = self.active_tab; + self.ribbon.close_dropdown(); let mut sel = self.tabs[i].scene.selection.borrow_mut(); let Some(p) = sel.last_move_pos else { return Task::none(); @@ -3095,6 +3100,7 @@ impl OpenCADStudio { Message::ViewportMiddlePress => { let i = self.active_tab; + self.ribbon.close_dropdown(); let now = Instant::now(); let is_double = { let sel = self.tabs[i].scene.selection.borrow();