forked from 1b-agent/opencadstudio-upstream
Merge pull request #1810 from ramox81/codex/insert-import-panel
Insert ribbon: Import panel # Conflicts: # locales/ar-SA/opencadstudio.ftl # locales/bg-BG/opencadstudio.ftl # locales/cs-CZ/opencadstudio.ftl # locales/de-DE/opencadstudio.ftl # locales/el-GR/opencadstudio.ftl # locales/en-US/opencadstudio.ftl # locales/es-ES/opencadstudio.ftl # locales/fi-FI/opencadstudio.ftl # locales/fr-FR/opencadstudio.ftl # locales/hi-IN/opencadstudio.ftl # locales/hu-HU/opencadstudio.ftl # locales/it-IT/opencadstudio.ftl # locales/ja-JP/opencadstudio.ftl # locales/ko-KR/opencadstudio.ftl # locales/lo-LA/opencadstudio.ftl # locales/nl-NL/opencadstudio.ftl # locales/pl-PL/opencadstudio.ftl # locales/pt-BR/opencadstudio.ftl # locales/ru-RU/opencadstudio.ftl # locales/tr-TR/opencadstudio.ftl # locales/zh-CN/opencadstudio.ftl # locales/zh-TW/opencadstudio.ftl # src/modules/insert/mod.rs # src/ui/ribbon/draw_panel.rs
This commit is contained in:
commit
443d3ec13d
33 files changed
+285
-42
No files matched your search
@@ -1,10 +0,0 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/landxml.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "LANDXMLIMPORT",
|
||||
label: "Land\nXML",
|
||||
icon: ICON,
|
||||
event: ModuleEvent::Command("LANDXMLIMPORT".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -12,10 +12,8 @@ pub(crate) mod dgn_import;
|
||||
pub(crate) mod edit_block;
|
||||
pub(crate) mod image_transparency;
|
||||
pub(crate) mod insert_block;
|
||||
mod landxml;
|
||||
pub mod minsert;
|
||||
mod mview_block;
|
||||
mod open_obj;
|
||||
pub(crate) mod pc_attach;
|
||||
pub(crate) mod pc_crop;
|
||||
pub(crate) mod pc_extract;
|
||||
@@ -33,11 +31,13 @@ pub(crate) mod xattach;
|
||||
pub(crate) mod xclip;
|
||||
pub(crate) mod xref_cmd;
|
||||
|
||||
use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem, ToolDef};
|
||||
use crate::modules::{CadModule, IconKind, ModuleEvent, RibbonGroup, RibbonItem, ToolDef};
|
||||
|
||||
/// Insert > Block Definition: the Create Block / Write Block split button.
|
||||
pub(crate) const CREATE_BLOCK_DROPDOWN: &str = "CREATE_BLOCK_DROPDOWN";
|
||||
|
||||
const IMPORT_ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/import_obj.svg"));
|
||||
|
||||
const FRAMES_ICON: IconKind =
|
||||
IconKind::Svg(include_bytes!("../../../assets/icons/underlay_frames.svg"));
|
||||
|
||||
@@ -164,12 +164,46 @@ impl CadModule for InsertModule {
|
||||
},
|
||||
],
|
||||
},
|
||||
// ── Import ────────────────────────────────────────────────────────
|
||||
// ── Import (slide-out: Land XML) ──────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Import",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(open_obj::tool()),
|
||||
RibbonItem::LargeTool(landxml::tool()),
|
||||
// The face names and runs the last one chosen. A `;`
|
||||
// answers the started command's prompt, as in a menu
|
||||
// macro.
|
||||
RibbonItem::LargeDropdown {
|
||||
id: "IMPORT_FILE",
|
||||
label: "",
|
||||
icon: IMPORT_ICON,
|
||||
items: vec![
|
||||
("PDFIMPORT;FILE", "PDF Import", underlay_layers::ICON),
|
||||
("DGNIMPORT", "DGN Import", underlay_layers::ICON),
|
||||
("IMPORT", "Import…", IMPORT_ICON),
|
||||
],
|
||||
default: "PDFIMPORT;FILE",
|
||||
},
|
||||
RibbonItem::LabeledTool(ToolDef {
|
||||
id: "PDFSHXTEXT",
|
||||
label: "Recognize SHX Text",
|
||||
icon: IconKind::Svg(include_bytes!("../../../assets/icons/text.svg")),
|
||||
event: ModuleEvent::Command("PDFSHXTEXT".to_string()),
|
||||
}),
|
||||
RibbonItem::LabeledTool(ToolDef {
|
||||
id: "PDFSHXTEXT_SETTINGS",
|
||||
label: "Recognition Settings",
|
||||
icon: IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/options_tool.svg"
|
||||
)),
|
||||
event: ModuleEvent::Command(
|
||||
"PDFSHXTEXTSETTINGS 1;PDFSHXTEXT;SETTINGS".to_string(),
|
||||
),
|
||||
}),
|
||||
RibbonItem::LargeTool(ToolDef {
|
||||
id: "TXT2MTXT",
|
||||
label: "Combine Text",
|
||||
icon: IconKind::Svg(include_bytes!("../../../assets/icons/mtext.svg")),
|
||||
event: ModuleEvent::Command("TXT2MTXT".to_string()),
|
||||
}),
|
||||
],
|
||||
},
|
||||
// ── Content ───────────────────────────────────────────────────────
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "OPEN",
|
||||
label: "Open",
|
||||
icon: IconKind::Svg(include_bytes!("../../../assets/icons/import_obj.svg")),
|
||||
event: ModuleEvent::OpenFileDialog,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user