forked from 1b-agent/opencadstudio-upstream
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:
1 parent
70f65270aa
commit
6fdd090176
2 files changed
+12
-17
No files matched your search
@@ -107,17 +107,8 @@ impl OpenCADStudio {
|
||||
|
||||
|
||||
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
|
||||
// touches the scene is inert — point the user at New / Open
|
||||
// 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.
|
||||
// Commands use `start_allowed`; other events need a drawing
|
||||
// and stay blocked on the Start page (#299, #388, #389).
|
||||
if self.tabs[self.active_tab].is_start && !matches!(event, ModuleEvent::Command(_)) {
|
||||
self.ribbon.close_dropdown();
|
||||
self.command_line
|
||||
|
||||
+10
-6
@@ -1267,11 +1267,7 @@ impl OpenCADStudio {
|
||||
}
|
||||
|
||||
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 } => {
|
||||
if let Some(path) = path {
|
||||
@@ -5722,7 +5718,15 @@ impl OpenCADStudio {
|
||||
crate::ui::window::about::platform_name(),
|
||||
crate::ui::window::about::architecture_name(),
|
||||
);
|
||||
iced::clipboard::write(info).discard()
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
{
|
||||
crate::sys::write_clipboard_text(&info);
|
||||
Task::none()
|
||||
}
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
iced::clipboard::write(info).discard()
|
||||
}
|
||||
}
|
||||
|
||||
// ── Plugin Manager window ─────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user