diff --git a/assets/ocad.pgp b/assets/ocad.pgp index 104ae72e2..b9b54bcd6 100644 --- a/assets/ocad.pgp +++ b/assets/ocad.pgp @@ -127,7 +127,6 @@ MO, *PROPERTIES UN, *UNITS TP, *TOOLPALETTES SSM, *SHEETSET -VW, *WIREFRAME HI, *HIDE 3O, *3DORBIT ORBIT, *3DORBIT diff --git a/crates/ocs_plugin_api/src/ribbon.rs b/crates/ocs_plugin_api/src/ribbon.rs index afe332517..282012897 100644 --- a/crates/ocs_plugin_api/src/ribbon.rs +++ b/crates/ocs_plugin_api/src/ribbon.rs @@ -17,8 +17,6 @@ pub enum ModuleEvent { /// Remove all loaded models from the scene. #[allow(dead_code)] ClearModels, - /// Toggle wireframe rendering. - SetWireframe(bool), /// Toggle the layer manager panel. ToggleLayers, /// Ask the host to open a native file picker. On selection the host diff --git a/src/app/commands/fileops.rs b/src/app/commands/fileops.rs index 7ce2b713f..3a3d8a5d9 100644 --- a/src/app/commands/fileops.rs +++ b/src/app/commands/fileops.rs @@ -103,66 +103,40 @@ impl OpenCADStudio { } } "CLEAR" | "CLR" => return Some(Task::done(Message::ClearScene)), - "WIREFRAME" => return Some(Task::done(Message::SetWireframe(true))), // Visual-style commands. OCS renders either a wireframe or a shaded // view; the named styles map onto the closest of the two and the // chosen style is reported so the mapping is explicit. (`SOLID` is // intentionally NOT a visual-style verb — it is the 2D filled-polygon // draw command; the shaded ribbon button drives `SetWireframe`.) - "VS" | "VSCURRENT" | "SHADEMODE" => { + // One interactive picker behind every verb that asks for a style, + // offering exactly what the render-mode widget offers. (#621) + "VS" | "VSCURRENT" | "SHADEMODE" | "VISUALSTYLES" => { use crate::command::KeywordCommand; + use crate::modules::view::visual_style; let c = KeywordCommand::new( "VSCURRENT", - "VSCURRENT visual style [Shaded / Wireframe / Hidden / Realistic / Conceptual / X-ray]:", - vec![ - ("Shaded", "SHADED", None), - ("Wireframe", "WIREFRAME", None), - ("Hidden", "HIDDEN", None), - ("Realistic", "REALISTIC", None), - ("Conceptual", "CONCEPTUAL", None), - ("X-Ray", "XRAY", None), - ], + visual_style::keyword_prompt(), + visual_style::keyword_choices(), ); self.command_line.push_info(&c.prompt()); self.tabs[i].active_cmd = Some(Box::new(c)); } - // The named visual-style shortcuts still switch directly, and the - // `