fix(ui): refine empty drawing state

Show drawing defaults when nothing is selected and disable layout controls on Start.

Refs #514
Refs #515
This commit is contained in:
Hakan Seven committed 2026-07-27 17:37:17 +03:00
1 parent 759f2316aa
commit 4a30928f5a
8 files changed
+341 -57

No files matched your search

+10
View File
@@ -3677,6 +3677,11 @@ impl OpenCADStudio {
pub(super) fn on_layout_switch(&mut self, name: String) -> Task<Message> {
let i = self.active_tab;
if self.tabs[i].is_start {
self.command_line
.push_info("Open or create a drawing to switch layouts.");
return Task::none();
}
// A BEDIT block editor locks the active space; finish it with
// Save Block or Discard before switching spaces. (#261)
if self.tabs[i].block_edit.is_some() {
@@ -3745,6 +3750,11 @@ impl OpenCADStudio {
pub(super) fn on_layout_create(&mut self) -> Task<Message> {
let i = self.active_tab;
if self.tabs[i].is_start {
self.command_line
.push_info("Open or create a drawing to add a layout.");
return Task::none();
}
// Find a unique name (e.g. Layout2, Layout3, ...).
let existing = self.tabs[i].scene.layout_names();
let mut idx = existing.len();