Redesign Select Color panel: index and true color tabs

Replace the old index page and the iced_aw ColorPicker popup with one
Select Color panel:

- Index Color tab: standard colors, ACI 10-249 grid, grays; arrow keys
  move through the palette.
- True Color tab: HSB, RGB and gradient-field modes built on two new
  widgets (GradientSlider, ColorArea) and iced_aw NumberInput boxes,
  an editable hex field and a nearest/exact index color button.
- Current/New swatch: clicking Current reverts. A mixed selection opens
  on the color of the most recently drawn object with *VARIES* on top.
- Color field accepts an index, a color name, r,g,b or hex.
- Enter confirms, Esc cancels, other keys stay in the panel.
- New labels translated in all 22 locales.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
Claude committed 2026-10-11 20:29:46 +00:00
1 parent cff240ef71
commit 00830f8714
36 files changed
+2173 -276

No files matched your search

+5 -17
View File
@@ -894,10 +894,8 @@ pub(super) struct OpenCADStudio {
#[cfg(target_arch = "wasm32")]
pending_web_thumbnail_save: Option<PendingWebThumbnailSave>,
// ── Floating panel windows ────────────────────────────────────────────
/// Active `iced_aw` colour picker: destination plus its initial colour.
color_pick_target: Option<(ColorPickTarget, AcadColor)>,
/// Visible page in the shared CAD colour picker.
color_picker_tab: ColorPickerTab,
/// The open Select Color panel, if any.
color_picker: Option<crate::ui::color_select::ColorPicker>,
/// Recently committed real colours, newest first.
/// ACI and True Color remain semantically distinct even when their RGB matches.
recent_colors: Vec<AcadColor>,
@@ -1590,13 +1588,6 @@ pub enum BgTarget {
Desk,
}
/// Active page in the shared CAD colour picker.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum ColorPickerTab {
#[default]
Index,
TrueColor,
}
/// Where a colour chosen in the standalone palette window should be applied.
#[derive(Debug, Clone)]
pub enum ColorPickTarget {
@@ -3911,10 +3902,8 @@ pub enum Message {
DsColorMore(DsField),
/// Open the shared CAD colour picker for a field and its current colour.
OpenColorWindow(ColorPickTarget, AcadColor),
/// Switch between Index Color and True Color.
ColorPickerTabChanged(ColorPickerTab),
/// Change the pending colour without committing it yet.
ColorPickerColorChanged(AcadColor),
/// Interaction inside the Select Color panel.
ColorPicker(crate::ui::color_select::ColorPickerMsg),
/// Close the colour picker without choosing.
CloseColorPicker,
/// Commit the colour chosen in the shared picker.
@@ -4318,8 +4307,7 @@ impl OpenCADStudio {
pending_native_thumbnail_save: None,
#[cfg(target_arch = "wasm32")]
pending_web_thumbnail_save: None,
color_pick_target: None,
color_picker_tab: ColorPickerTab::Index,
color_picker: None,
recent_colors: Vec::new(),
active_modal: None,
hyperlink_editor_handles: Vec::new(),