forked from 1b-agent/opencadstudio-upstream
feat(ui): move full ACI palette to a separate "Select Color" window (#94)
The colour selector popup now lists only the named colours (ByLayer, ByBlock, ACI 1-9) plus a "More…" entry. "More…" opens a standalone "Select Color" window with the full 256-colour grid; picking there applies to the originating field (dimension/multileader/table style) and closes the window. Routed via a ColorPickTarget so one window serves every field. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a87a18f32
commit
3d050fe1ab
7 files changed
+146
-24
No files matched your search
@@ -287,6 +287,9 @@ pub(super) struct OpenCADStudio {
|
||||
layout_manager_window: Option<window::Id>,
|
||||
plotstyle_window: Option<window::Id>,
|
||||
dimstyle_window: Option<window::Id>,
|
||||
/// Standalone "Select Color" palette window + the field it targets.
|
||||
color_pick_window: Option<window::Id>,
|
||||
color_pick_target: Option<ColorPickTarget>,
|
||||
shortcuts_window: Option<window::Id>,
|
||||
about_window: Option<window::Id>,
|
||||
/// New-release notification window — opened on startup when the
|
||||
@@ -565,6 +568,14 @@ pub(super) enum PendingClose {
|
||||
Quit,
|
||||
}
|
||||
|
||||
/// Where a colour chosen in the standalone palette window should be applied.
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ColorPickTarget {
|
||||
DimStyle(DsField),
|
||||
MLeader(&'static str),
|
||||
Table(u8, &'static str),
|
||||
}
|
||||
|
||||
/// Identifies a DimStyle field that can be edited in the dialog.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum DsField {
|
||||
@@ -1267,6 +1278,10 @@ pub enum Message {
|
||||
DsToggle(DsField),
|
||||
/// Toggle the expanded colour palette for a DimStyle colour field.
|
||||
DsColorMore(DsField),
|
||||
/// Open the standalone palette window targeting the given field.
|
||||
OpenColorWindow(ColorPickTarget),
|
||||
/// A colour was chosen in the standalone palette window.
|
||||
ColorWindowPick(acadrust::types::Color),
|
||||
/// Set a block/linetype Handle field on the selected dim style from a
|
||||
/// dropdown of available block-records / linetypes (by name).
|
||||
DsSetHandle {
|
||||
@@ -1377,6 +1392,8 @@ impl OpenCADStudio {
|
||||
layout_manager_window: None,
|
||||
plotstyle_window: None,
|
||||
dimstyle_window: None,
|
||||
color_pick_window: None,
|
||||
color_pick_target: None,
|
||||
shortcuts_window: None,
|
||||
about_window: None,
|
||||
update_notice_window: None,
|
||||
@@ -1656,6 +1673,9 @@ pub fn run() -> iced::Result {
|
||||
if Some(window_id) == state.layer_window {
|
||||
return "Layer Properties Manager".into();
|
||||
}
|
||||
if Some(window_id) == state.color_pick_window {
|
||||
return "Select Color".into();
|
||||
}
|
||||
if Some(window_id) == state.page_setup_window {
|
||||
return "Page Setup".into();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user