Merge pull request #1722 from ramox81/codex/view-background

# Conflicts:
#	locales/ar-SA/opencadstudio.ftl
#	locales/bg-BG/opencadstudio.ftl
#	locales/cs-CZ/opencadstudio.ftl
#	locales/de-DE/opencadstudio.ftl
#	locales/el-GR/opencadstudio.ftl
#	locales/en-US/opencadstudio.ftl
#	locales/es-ES/opencadstudio.ftl
#	locales/fi-FI/opencadstudio.ftl
#	locales/fr-FR/opencadstudio.ftl
#	locales/hi-IN/opencadstudio.ftl
#	locales/hu-HU/opencadstudio.ftl
#	locales/it-IT/opencadstudio.ftl
#	locales/ja-JP/opencadstudio.ftl
#	locales/ko-KR/opencadstudio.ftl
#	locales/lo-LA/opencadstudio.ftl
#	locales/nl-NL/opencadstudio.ftl
#	locales/pl-PL/opencadstudio.ftl
#	locales/pt-BR/opencadstudio.ftl
#	locales/ru-RU/opencadstudio.ftl
#	locales/tr-TR/opencadstudio.ftl
#	locales/zh-CN/opencadstudio.ftl
#	locales/zh-TW/opencadstudio.ftl
This commit is contained in:
Hakan Seven committed 2026-10-13 07:44:01 +03:00
commit 03445a540d
40 files changed
+1801 -46

No files matched your search

+7
View File
@@ -9315,6 +9315,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();
+12
View File
@@ -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)),
),
+22 -7
View File
@@ -1090,6 +1090,28 @@ impl OpenCADStudio {
.push_output(crate::tf!("Viewport visual style: {label}").as_ref());
return Task::none();
}
self.apply_render_mode(i, mode, label);
// The viewport record carries the style the mode is saved as.
self.tabs[i]
.scene
.set_active_visual_style_named(crate::modules::view::visual_style::style_name_for(mode));
self.command_line
.push_output(crate::tf!("Visual style: {label}").as_ref());
// The point cloud move gizmo follows the visual style.
if i == self.active_tab {
self.refresh_selected_grips();
}
Task::none()
}
/// The model tab's visual style, without a message.
pub(crate) fn apply_render_mode(
&mut self,
i: usize,
mode: codec::entities::ViewportRenderMode,
label: &str,
) {
use codec::entities::ViewportRenderMode as M;
self.tabs[i].render_mode = mode;
// Write the style onto the active Model tile alone so it
// sticks when that tile loses focus and the other tiles keep
@@ -1105,13 +1127,6 @@ impl OpenCADStudio {
// pipeline keys its upload cache off `geometry_epoch`.
self.tabs[i].scene.bump_geometry_no_blocks();
self.tabs[i].dirty = true;
self.command_line
.push_output(crate::tf!("Visual style: {label}").as_ref());
// The point cloud move gizmo follows the visual style.
if i == self.active_tab {
self.refresh_selected_grips();
}
Task::none()
}
pub(super) fn on_cursor_moved(