forked from 1b-agent/opencadstudio-upstream
Select Color: bottom-aligned field, list view, name sorting, book names
- True Color opens in RGB; the gradient field, hex and nearest index sit at the bottom so CMYK's fourth slider doesn't move them; slider rows closer together. - Document tab: grid or list view (list drawn like the colour-book bars), and Name A–Z / Z–A sorting (translated in all locales). Swatches of colour-book colours show the colour's name. - A colour-book colour picked as the current colour (nothing selected) keeps its BOOK$NAME on the objects drawn with it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013rGmDUNr1hUf4zo1X3dak8
This commit is contained in:
33 files changed
+221
-53
No files matched your search
@@ -358,7 +358,11 @@ impl OpenCADStudio {
|
||||
if layer != "0" || entity.as_entity().layer().is_empty() {
|
||||
entity.as_entity_mut().set_layer(layer);
|
||||
}
|
||||
crate::scene::view::dispatch::apply_color(&mut entity, self.ribbon.active_color);
|
||||
crate::scene::view::dispatch::apply_named_color(
|
||||
&mut entity,
|
||||
self.ribbon.active_color,
|
||||
self.ribbon.active_color_name(),
|
||||
);
|
||||
crate::scene::view::dispatch::apply_common_prop(
|
||||
&mut entity,
|
||||
"linetype",
|
||||
@@ -476,7 +480,11 @@ impl OpenCADStudio {
|
||||
if layer != "0" || entity.as_entity().layer().is_empty() {
|
||||
entity.as_entity_mut().set_layer(layer);
|
||||
}
|
||||
crate::scene::view::dispatch::apply_color(&mut entity, self.ribbon.active_color);
|
||||
crate::scene::view::dispatch::apply_named_color(
|
||||
&mut entity,
|
||||
self.ribbon.active_color,
|
||||
self.ribbon.active_color_name(),
|
||||
);
|
||||
crate::scene::view::dispatch::apply_common_prop(
|
||||
&mut entity,
|
||||
"linetype",
|
||||
|
||||
@@ -3149,7 +3149,11 @@ handles={handles_ms:.1} panel={:.1} ribbon={ribbon_ms:.1} tail={:.1} selected={}
|
||||
}
|
||||
|
||||
if !preserve_entity_style {
|
||||
crate::scene::view::dispatch::apply_color(&mut entity, self.ribbon.active_color);
|
||||
crate::scene::view::dispatch::apply_named_color(
|
||||
&mut entity,
|
||||
self.ribbon.active_color,
|
||||
self.ribbon.active_color_name(),
|
||||
);
|
||||
crate::scene::view::dispatch::apply_common_prop(
|
||||
&mut entity,
|
||||
"linetype",
|
||||
|
||||
@@ -11699,6 +11699,9 @@ impl OpenCADStudio {
|
||||
};
|
||||
match target {
|
||||
crate::app::ColorPickTarget::Properties => {}
|
||||
crate::app::ColorPickTarget::Ribbon => {
|
||||
return (color, false, self.ribbon.active_color_name());
|
||||
}
|
||||
crate::app::ColorPickTarget::Layer(layer) => {
|
||||
let name = document.layers.get(layer).and_then(|layer| {
|
||||
match (&layer.book_name, &layer.color_name) {
|
||||
@@ -11767,6 +11770,7 @@ impl OpenCADStudio {
|
||||
let handles = self.property_target_handles(i);
|
||||
if handles.is_empty() {
|
||||
let task = self.on_ribbon_color_changed(color);
|
||||
self.ribbon.active_color_book = name.map(|name| (color, name));
|
||||
self.refresh_properties();
|
||||
return task;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1215,11 @@ impl OpenCADStudio {
|
||||
Some(Message::PropColorFieldChanged { field, color })
|
||||
}
|
||||
Some(crate::app::ColorPickTarget::MText) => Some(Message::MTextColorChanged(color)),
|
||||
Some(crate::app::ColorPickTarget::Ribbon) => Some(Message::RibbonColorChanged(color)),
|
||||
Some(crate::app::ColorPickTarget::Ribbon) => {
|
||||
let task = self.update(Message::RibbonColorChanged(color));
|
||||
self.ribbon.active_color_book = name.map(|name| (color, name));
|
||||
return task;
|
||||
}
|
||||
Some(crate::app::ColorPickTarget::Layer(layer)) => {
|
||||
let i = self.active_tab;
|
||||
match self.layer_panel_index(i, &layer) {
|
||||
|
||||
Reference in new issue
Block a user