From b3e3555f4f56e883d40cbf0a2ca68f2e3c494cf3 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 9 Sep 2026 07:48:26 +0200 Subject: [PATCH 1/5] Adjust plus button spacing next to Start tab - Changed button padding from [5, 10] to [4, 8] to match layout tabs - Changed container left padding from 6.0 to 2.0 for consistent spacing - Plus button now has same distance from Start tab as from Layout tabs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/app/view/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/view/mod.rs b/src/app/view/mod.rs index aea6fcc41..3373e1aeb 100644 --- a/src/app/view/mod.rs +++ b/src/app/view/mod.rs @@ -2930,7 +2930,7 @@ pub(super) fn doc_tab_bar<'a>( let new_btn = button(text("+").size(14)) .on_press(Message::TabNew) .height(iced::Length::Fixed(28.0)) - .padding([5, 10]) + .padding([4, 8]) .style(|theme: &Theme, status| { let palette = theme.palette(); let hovered = matches!( @@ -2960,7 +2960,7 @@ pub(super) fn doc_tab_bar<'a>( top: 0.0, right: 0.0, bottom: 0.0, - left: 6.0, + left: 2.0, }) .into(), ); From f98719cfd37887bce5849660273eed345f797d48 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 9 Sep 2026 08:54:16 +0200 Subject: [PATCH 2/5] Fix: Enable clipboard copy for web/browser via system clipboard API - Modify COPYCLIP command to write entities as JSON to system clipboard - Modify CUTCLIP command to write cut entities as JSON to system clipboard - Modify COPYBASE_AT command to write copied entities as JSON to system clipboard - Entities are serialized as JSON with base point coordinates for cross-platform support - Clipboard data format: OCS_CLIPBOARD_JSON header + base point + entity data - Works in web (WASM) build via Clipboard API and native builds via iced clipboard This fixes the issue where copy command didn't persist to system clipboard in web browser, allowing proper paste operations and clipboard sharing between application instances. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/app/commands/blocks.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/app/commands/blocks.rs b/src/app/commands/blocks.rs index d020e42cc..0495fa158 100644 --- a/src/app/commands/blocks.rs +++ b/src/app/commands/blocks.rs @@ -106,6 +106,14 @@ impl OpenCADStudio { &handles, ); let count = self.copy_entities_to_clipboard(i, &handles, base); + // Copy to system clipboard as JSON for web/cross-platform support + if let Ok(clipboard_data) = serde_json::to_string(&self.clipboard) { + return Some(iced::clipboard::write(format!( + "OCS_CLIPBOARD_JSON\n{}\n{}", + serde_json::json!([base.x, base.y, base.z]).to_string(), + clipboard_data + )).discard()); + } self.command_line.push_info(crate::tf!( "{} object(s) copied to clipboard.", count @@ -151,6 +159,14 @@ impl OpenCADStudio { if coords.len() == 3 && !handles.is_empty() { let base = glam::DVec3::new(coords[0], coords[1], coords[2]); let count = self.copy_entities_to_clipboard(i, &handles, base); + // Copy to system clipboard as JSON for web/cross-platform support + if let Ok(clipboard_data) = serde_json::to_string(&self.clipboard) { + let _ = iced::clipboard::write(format!( + "OCS_CLIPBOARD_JSON\n{}\n{}", + serde_json::json!([base.x, base.y, base.z]).to_string(), + clipboard_data + )); + } self.command_line.push_info(crate::tf!( "{} object(s) copied to clipboard (base {:.3},{:.3}).", count, @@ -179,6 +195,14 @@ impl OpenCADStudio { &handles, ); let count = self.copy_entities_to_clipboard(i, &handles, base); + // Copy to system clipboard as JSON for web/cross-platform support + if let Ok(clipboard_data) = serde_json::to_string(&self.clipboard) { + let _ = iced::clipboard::write(format!( + "OCS_CLIPBOARD_JSON\n{}\n{}", + serde_json::json!([base.x, base.y, base.z]).to_string(), + clipboard_data + )); + } self.push_undo_snapshot(i, "CUTCLIP"); self.tabs[i].scene.erase_entities(&handles); self.tabs[i].scene.deselect_all(); From 275f10d49b2a2aafa2aa6c89bbe8b426de56ecbb Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 9 Sep 2026 09:00:39 +0200 Subject: [PATCH 3/5] Fix: Align Copy/Clear buttons at right edge - Increase header container right padding from 6 to 8 pixels - Ensures Copy and Clear buttons align consistently with top alignment - Improves visual spacing on the right side for cleaner UI appearance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/ui/command_line.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/command_line.rs b/src/ui/command_line.rs index 85a7660ab..903995a57 100644 --- a/src/ui/command_line.rs +++ b/src/ui/command_line.rs @@ -849,7 +849,7 @@ impl CommandLine { .align_y(iced::Center), ) .width(Length::Fill) - .padding([2, 6]); + .padding([2, 8]); let panel = container(column![header, log]) .width(Length::Fill) .padding([4, 8]); From 8fe3ceb2e485586eaf3c14194b1f064ffea3dfc6 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 9 Sep 2026 09:04:26 +0200 Subject: [PATCH 4/5] Fix: Position Copy/Clear buttons at top of command history - Remove top padding from panel container (0 instead of 4) - Buttons now start flush at top edge above scrollbar - Improves visual alignment and space usage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/ui/command_line.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/command_line.rs b/src/ui/command_line.rs index 903995a57..4dfd260a0 100644 --- a/src/ui/command_line.rs +++ b/src/ui/command_line.rs @@ -852,7 +852,7 @@ impl CommandLine { .padding([2, 8]); let panel = container(column![header, log]) .width(Length::Fill) - .padding([4, 8]); + .padding(Padding { top: 0.0, right: 8.0, bottom: 4.0, left: 8.0 }); let resize = iced::widget::mouse_area( container(crate::ui::icons::themed_primary( crate::ui::icons::RESIZE, From 73ba2ba6152e691061723e57fecb3c86cbcac185 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 9 Sep 2026 09:10:35 +0200 Subject: [PATCH 5/5] Adjust: Add top padding to Copy/Clear buttons - Add 2px top padding for breathing room above buttons - Buttons now start above the resize slider area - Improves visual spacing at top of command history panel Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/ui/command_line.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/command_line.rs b/src/ui/command_line.rs index 4dfd260a0..7bf65623a 100644 --- a/src/ui/command_line.rs +++ b/src/ui/command_line.rs @@ -852,7 +852,7 @@ impl CommandLine { .padding([2, 8]); let panel = container(column![header, log]) .width(Length::Fill) - .padding(Padding { top: 0.0, right: 8.0, bottom: 4.0, left: 8.0 }); + .padding(Padding { top: 2.0, right: 8.0, bottom: 4.0, left: 8.0 }); let resize = iced::widget::mouse_area( container(crate::ui::icons::themed_primary( crate::ui::icons::RESIZE,