forked from 1b-agent/opencadstudio-upstream
feat: Layout Manager GUI (LAYOUTMANAGER / LAYOUTPANEL command)
Panel overlay showing all layouts with their active status. Supports: select, rename, new, delete, reorder (◀▶), set current. Also adds Scene::swap_layout_order() for tab-order resequencing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b8d15e5155
commit
85f9b930a2
6 files changed
+387
-2
No files matched your search
@@ -1057,6 +1057,26 @@ impl Scene {
|
||||
true
|
||||
}
|
||||
|
||||
/// Swap the `tab_order` of two paper layouts so they appear in swapped order.
|
||||
pub fn swap_layout_order(&mut self, name_a: &str, name_b: &str) {
|
||||
let mut order_a: Option<i16> = None;
|
||||
let mut order_b: Option<i16> = None;
|
||||
for obj in self.document.objects.values() {
|
||||
if let ObjectType::Layout(l) = obj {
|
||||
if l.name == name_a { order_a = Some(l.tab_order); }
|
||||
if l.name == name_b { order_b = Some(l.tab_order); }
|
||||
}
|
||||
}
|
||||
if let (Some(oa), Some(ob)) = (order_a, order_b) {
|
||||
for obj in self.document.objects.values_mut() {
|
||||
if let ObjectType::Layout(l) = obj {
|
||||
if l.name == name_a { l.tab_order = ob; }
|
||||
else if l.name == name_b { l.tab_order = oa; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Entity management ─────────────────────────────────────────────────
|
||||
|
||||
pub fn add_entity(&mut self, mut entity: EntityType) -> Handle {
|
||||
|
||||
Reference in new issue
Block a user