forked from 1b-agent/opencadstudio-upstream
Insert ribbon: Block Definition panel split button and labels
The Block Definition panel's Create Block is a split button listing Create Block and Write Block; its face runs the last one chosen. The slide-out lists Set Base Point and Synchronize with their labels, and the large buttons read Manage Attributes and Block Editor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
39c3e9af58
commit
5cd87ac24b
4 files changed
+77
-6
No files matched your search
@@ -32,7 +32,10 @@ pub(crate) mod xattach;
|
||||
pub(crate) mod xclip;
|
||||
pub(crate) mod xref_cmd;
|
||||
|
||||
use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem};
|
||||
use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem, ToolDef};
|
||||
|
||||
/// Insert > Block Definition: the Create Block / Write Block split button.
|
||||
pub(crate) const CREATE_BLOCK_DROPDOWN: &str = "CREATE_BLOCK_DROPDOWN";
|
||||
|
||||
const FRAMES_ICON: IconKind =
|
||||
IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg"));
|
||||
@@ -85,10 +88,26 @@ impl CadModule for InsertModule {
|
||||
RibbonGroup {
|
||||
title: "Block Definition",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(create_block::tool()),
|
||||
// Split button: the face runs the last one chosen.
|
||||
RibbonItem::LargeDropdown {
|
||||
id: CREATE_BLOCK_DROPDOWN,
|
||||
label: "Create Block",
|
||||
icon: create_block::tool().icon,
|
||||
items: vec![
|
||||
("BLOCK", "Create Block", create_block::tool().icon),
|
||||
("WBLOCK", "Write Block", wblock::tool().icon),
|
||||
],
|
||||
default: "BLOCK",
|
||||
},
|
||||
RibbonItem::LargeTool(attdef::tool()),
|
||||
RibbonItem::LargeTool(attman::tool()),
|
||||
RibbonItem::LargeTool(edit_block::tool()),
|
||||
RibbonItem::LargeTool(ToolDef {
|
||||
label: "Manage Attributes",
|
||||
..attman::tool()
|
||||
}),
|
||||
RibbonItem::LargeTool(ToolDef {
|
||||
label: "Block Editor",
|
||||
..edit_block::tool()
|
||||
}),
|
||||
],
|
||||
},
|
||||
// ── Reference ────────────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user