forked from 1b-agent/opencadstudio-upstream
Unify mixed color selection
Use the shared color selector for mixed property values and remove the legacy inline palette and its state.
This commit is contained in:
1 parent
8c9ef80b90
commit
93b441d4b8
6 files changed
+76
-284
No files matched your search
@@ -2523,8 +2523,6 @@ pub enum Message {
|
||||
/// properties-panel dropdown (a combo_box) opens, so at most one panel
|
||||
/// dropdown is open at a time and they can't overlap. (#235)
|
||||
PropColorPickerClose,
|
||||
/// Toggle the full ACI colour palette expansion.
|
||||
PropColorPaletteToggle,
|
||||
/// Enter the model-space editing mode inside the given viewport (MSPACE).
|
||||
EnterViewport(acadrust::Handle),
|
||||
/// Exit MSPACE and return to paper-space editing (PSPACE).
|
||||
|
||||
@@ -42,7 +42,6 @@ impl OpenCADStudio {
|
||||
// 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 active_field = std::mem::take(&mut self.tabs[i].properties.active_field);
|
||||
// Expanded coordinate groups persist across rebuilds AND selection
|
||||
@@ -2224,7 +2223,6 @@ impl OpenCADStudio {
|
||||
// Precompute the focused-id → field-key map for O(1) lookups on
|
||||
// `PropSyncActive`; derived from `sections`, so rebuild it here.
|
||||
panel.field_key_by_id = crate::ui::properties::build_field_key_map(&panel.sections);
|
||||
panel.color_palette_open = color_palette_open;
|
||||
let new_handles: Vec<acadrust::Handle> = selected.iter().map(|(h, _)| *h).collect();
|
||||
// Carry the in-progress edits only when the selection is unchanged
|
||||
// (a commit-triggered rebuild); a genuine selection change starts
|
||||
@@ -2265,7 +2263,6 @@ impl OpenCADStudio {
|
||||
panel.edit_buf.clear();
|
||||
panel.active_field = None;
|
||||
panel.color_picker_open = false;
|
||||
panel.color_palette_open = false;
|
||||
panel.bg_color_picker_open = false;
|
||||
panel.open_color_field = None;
|
||||
panel.hatch_pattern_picker_open = false;
|
||||
|
||||
@@ -4653,7 +4653,6 @@ impl OpenCADStudio {
|
||||
let i = self.active_tab;
|
||||
let handles = self.property_target_handles(i);
|
||||
if handles.is_empty() {
|
||||
self.tabs[i].properties.color_palette_open = false;
|
||||
let task = self.on_ribbon_color_changed(color);
|
||||
self.refresh_properties();
|
||||
return task;
|
||||
@@ -4666,7 +4665,6 @@ impl OpenCADStudio {
|
||||
}
|
||||
});
|
||||
self.tabs[i].properties.color_picker_open = false;
|
||||
self.tabs[i].properties.color_palette_open = false;
|
||||
Task::none()
|
||||
}
|
||||
|
||||
@@ -4751,7 +4749,6 @@ impl OpenCADStudio {
|
||||
panel.hatch_pattern_picker_open = !panel.hatch_pattern_picker_open;
|
||||
if panel.hatch_pattern_picker_open {
|
||||
panel.color_picker_open = false;
|
||||
panel.color_palette_open = false;
|
||||
panel.open_color_field = None;
|
||||
panel.edit_choice_open = false;
|
||||
panel.hatch_pattern_focus =
|
||||
@@ -5069,7 +5066,6 @@ impl OpenCADStudio {
|
||||
self.tabs[i].properties.color_picker_open =
|
||||
!self.tabs[i].properties.color_picker_open;
|
||||
if self.tabs[i].properties.color_picker_open {
|
||||
self.tabs[i].properties.color_palette_open = false;
|
||||
self.tabs[i].properties.hatch_pattern_picker_open = false;
|
||||
self.tabs[i].properties.hatch_pattern_search.clear();
|
||||
}
|
||||
@@ -5311,18 +5307,11 @@ impl OpenCADStudio {
|
||||
Message::PropColorPickerClose => {
|
||||
let i = self.active_tab;
|
||||
self.tabs[i].properties.color_picker_open = false;
|
||||
self.tabs[i].properties.color_palette_open = false;
|
||||
self.tabs[i].properties.hatch_pattern_picker_open = false;
|
||||
self.tabs[i].properties.hatch_pattern_search.clear();
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::PropColorPaletteToggle => {
|
||||
self.tabs[self.active_tab].properties.color_palette_open =
|
||||
!self.tabs[self.active_tab].properties.color_palette_open;
|
||||
Task::none()
|
||||
}
|
||||
|
||||
Message::LayoutSwitch(name) => {
|
||||
self.layout_list_open = false;
|
||||
self.on_layout_switch(name)
|
||||
|
||||
@@ -2657,7 +2657,6 @@ impl OpenCADStudio {
|
||||
// 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
|
||||
|
||||
Reference in new issue
Block a user