diff --git a/src/app/properties.rs b/src/app/properties.rs index c2c204d26..335326221 100644 --- a/src/app/properties.rs +++ b/src/app/properties.rs @@ -10,7 +10,9 @@ impl OpenCADStudio { /// Preserves UI state (open pickers, edit buffer) across refreshes. pub(super) fn refresh_properties(&mut self) { let i = self.active_tab; - let color_picker_open = self.tabs[i].properties.color_picker_open; + // Note: the color-picker dropdown is intentionally NOT carried over — a + // rebuild means the selection (or a property) changed, so the dropdown + // closes, matching the deselect / reselect / click-away expectation. let color_palette_open = self.tabs[i].properties.color_palette_open; let edit_buf = std::mem::take(&mut self.tabs[i].properties.edit_buf); let selected_group = self.tabs[i].properties.selected_group.clone(); @@ -307,7 +309,6 @@ impl OpenCADStudio { } } }; - panel.color_picker_open = color_picker_open; panel.color_palette_open = color_palette_open; panel.edit_buf = edit_buf; panel diff --git a/src/app/update.rs b/src/app/update.rs index 96223a3d1..abc60ecbc 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -2779,6 +2779,11 @@ impl OpenCADStudio { // (e.g. the annotation style combo), which has no backdrop of // its own to catch outside clicks. self.ribbon.close_dropdown(); + // Likewise dismiss the Properties color dropdowns — a viewport + // press starts a box selection, so without this they'd only + // close on the second click (issue #104). + self.tabs[i].properties.color_picker_open = false; + self.tabs[i].properties.color_palette_open = false; // 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