forked from 1b-agent/opencadstudio-upstream
-VIEW sEttings Background dialog and view backgrounds
Color, Gradient and Image at the background prompt open a Background dialog (None / Solid / Gradient / Image, preview, solid colour, two- or three-colour gradient with rotation, image file with position and scale). Apply links the view to a new background object in ACAD_BACKGROUND; restoring a view gives the model viewport a copy of it (or none), and saving a view copies the viewport's background. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cd07141cde
commit
c8167c54ee
34 files changed
+1400
-4
No files matched your search
@@ -8799,6 +8799,13 @@ impl OpenCADStudio {
|
||||
self.close_sheet_set_dialog();
|
||||
return Task::none();
|
||||
}
|
||||
// The Background dialog returns to -VIEW's settings prompt.
|
||||
if self.active_modal == Some(super::ModalKind::ViewBackground) {
|
||||
self.view_background = None;
|
||||
self.close_active_modal();
|
||||
let i = self.active_tab;
|
||||
return self.run_dash_view("SETTINGS", i);
|
||||
}
|
||||
if self.active_modal == Some(super::ModalKind::Field) {
|
||||
self.close_field_dialog();
|
||||
return Task::none();
|
||||
|
||||
@@ -1162,6 +1162,18 @@ impl OpenCADStudio {
|
||||
crate::ui::window::gradient_editor::GradientMsg::Color(index, color),
|
||||
)))
|
||||
}
|
||||
Some(crate::app::ColorPickTarget::ViewBackground(slot)) => {
|
||||
let rgb = match color {
|
||||
codec::types::Color::Rgb { r, g, b } => Some([r, g, b]),
|
||||
codec::types::Color::Index(index) => {
|
||||
codec::types::aci_table::aci_to_rgb(index).map(|(r, g, b)| [r, g, b])
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
rgb.map(|rgb| {
|
||||
Message::PdfDialog(crate::ui::window::pdf_dialogs::PdfDialogMsg::BgColor(slot, rgb))
|
||||
})
|
||||
}
|
||||
Some(crate::app::ColorPickTarget::GraphicAttributesLine) => Some(
|
||||
Message::GraphicAttributes(GraphicAttributesMsg::LineColor(color)),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user