fix(ui): restore start actions and web copy
Route About info through browser clipboard on WASM. Let Start-page links reach the existing command allowlist. Refs #707 Refs #738
This commit is contained in:
parent
70f65270aa
commit
6fdd090176
2 changed files with 12 additions and 17 deletions
|
|
@ -107,17 +107,8 @@ impl OpenCADStudio {
|
||||||
|
|
||||||
|
|
||||||
pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEvent) -> Task<Message> {
|
pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEvent) -> Task<Message> {
|
||||||
// On the Start page there is no drawing to act on, so a tool that
|
// Commands use `start_allowed`; other events need a drawing
|
||||||
// touches the scene is inert — point the user at New / Open
|
// and stay blocked on the Start page (#299, #388, #389).
|
||||||
// instead of running it into the empty welcome tab (#299).
|
|
||||||
//
|
|
||||||
// Commands are exempt: `dispatch_command` already decides which
|
|
||||||
// ones stand alone (About, Donate, Report, the web link…) and
|
|
||||||
// reports the rest. Refusing them here shadowed that list and
|
|
||||||
// killed the welcome page's own buttons, which by definition can
|
|
||||||
// only ever be clicked while `is_start` holds (#388, #389).
|
|
||||||
// Keep the policy in one place — this door must not second-guess
|
|
||||||
// it. Every other event below mutates the scene or its panels.
|
|
||||||
if self.tabs[self.active_tab].is_start && !matches!(event, ModuleEvent::Command(_)) {
|
if self.tabs[self.active_tab].is_start && !matches!(event, ModuleEvent::Command(_)) {
|
||||||
self.ribbon.close_dropdown();
|
self.ribbon.close_dropdown();
|
||||||
self.command_line
|
self.command_line
|
||||||
|
|
|
||||||
|
|
@ -1267,12 +1267,8 @@ impl OpenCADStudio {
|
||||||
}
|
}
|
||||||
|
|
||||||
Message::RibbonToolClick { tool_id, event } => {
|
Message::RibbonToolClick { tool_id, event } => {
|
||||||
if self.tabs[self.active_tab].is_start {
|
|
||||||
Task::none()
|
|
||||||
} else {
|
|
||||||
self.on_ribbon_tool_click(tool_id, event)
|
self.on_ribbon_tool_click(tool_id, event)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Message::PluginFileDialogResult { command, path } => {
|
Message::PluginFileDialogResult { command, path } => {
|
||||||
if let Some(path) = path {
|
if let Some(path) = path {
|
||||||
// Dispatch "<command> <path>" with original case intact —
|
// Dispatch "<command> <path>" with original case intact —
|
||||||
|
|
@ -5722,8 +5718,16 @@ impl OpenCADStudio {
|
||||||
crate::ui::window::about::platform_name(),
|
crate::ui::window::about::platform_name(),
|
||||||
crate::ui::window::about::architecture_name(),
|
crate::ui::window::about::architecture_name(),
|
||||||
);
|
);
|
||||||
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
{
|
||||||
|
crate::sys::write_clipboard_text(&info);
|
||||||
|
Task::none()
|
||||||
|
}
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
{
|
||||||
iced::clipboard::write(info).discard()
|
iced::clipboard::write(info).discard()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ── Plugin Manager window ─────────────────────────────────────
|
// ── Plugin Manager window ─────────────────────────────────────
|
||||||
Message::PluginManagerOpen => {
|
Message::PluginManagerOpen => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue