forked from 1b-agent/opencadstudio-upstream
Merge pull request #1613 from ramox81/codex/sheet-set-manager
Sheet Set Manager, NEWSHEETSET / OPENSHEETSET and sheet set fields
This commit is contained in:
commit
078306d8fc
50 files changed
+8974
-27
No files matched your search
@@ -1888,6 +1888,7 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
crate::ui::dock::PanelId::Browser => self.show_browser,
|
||||
crate::ui::dock::PanelId::NodeGraph => self.show_node_graph,
|
||||
crate::ui::dock::PanelId::PointCloudManager => self.pc_manager.show,
|
||||
crate::ui::dock::PanelId::SheetSetManager => self.sheet_set.show,
|
||||
}
|
||||
};
|
||||
let edge_stack = |side: crate::app::config::DockSide| -> Option<Element<'_, Message>> {
|
||||
@@ -2642,6 +2643,14 @@ impl OpenCADStudio {
|
||||
};
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let plugin_drain = Subscription::none();
|
||||
// Open sheet sets reload when their .dst changes on disk.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
// Open sheet sets reload when their .dst changes on disk; the
|
||||
// drawings' .dwl lock files follow the open tabs.
|
||||
let sheet_set_poll = iced::time::every(std::time::Duration::from_secs(1))
|
||||
.map(|_| Message::SheetSet(crate::ui::window::sheet_set::SheetSetMsg::Poll));
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
let sheet_set_poll = Subscription::none();
|
||||
let hatch_pattern_keys = if self.tabs[self.active_tab]
|
||||
.properties
|
||||
.hatch_pattern_picker_open
|
||||
@@ -2843,6 +2852,7 @@ impl OpenCADStudio {
|
||||
web_fonts,
|
||||
autosave,
|
||||
plugin_drain,
|
||||
sheet_set_poll,
|
||||
single_instance,
|
||||
hatch_pattern_keys,
|
||||
keyboard_events,
|
||||
@@ -3029,6 +3039,9 @@ impl OpenCADStudio {
|
||||
width,
|
||||
auto_collapse,
|
||||
),
|
||||
crate::ui::dock::PanelId::SheetSetManager => {
|
||||
crate::ui::window::sheet_set::view(&self.sheet_set, width, auto_collapse)
|
||||
}
|
||||
};
|
||||
let divider = dock_divider(id);
|
||||
match side {
|
||||
|
||||
@@ -75,6 +75,7 @@ impl OpenCADStudio {
|
||||
Some(K::RecoveryPrompt) => crate::tr!("modal", "recovery-prompt"),
|
||||
Some(K::GpuWarning) => crate::tr!("gpu", "title"),
|
||||
Some(K::XrefHelp) => crate::t!("Reference Manager Help").into_owned(),
|
||||
Some(K::SheetSet) => self.sheet_set.dialog.as_ref().map(|d| d.title()).unwrap_or_default(),
|
||||
None => String::new(),
|
||||
}
|
||||
}
|
||||
@@ -580,6 +581,24 @@ impl OpenCADStudio {
|
||||
let state = self.attdef_dialog.as_ref()?;
|
||||
sized_flow(ex, 720, 520, |flow| crate::ui::window::attdef_dialog::view(state, flow))
|
||||
}
|
||||
super::super::ModalKind::SheetSet => {
|
||||
let (w, h) = match self.sheet_set.dialog.as_ref()? {
|
||||
crate::ui::window::sheet_set::SsDialog::Wizard(_) => (720, 560),
|
||||
crate::ui::window::sheet_set::SsDialog::Properties(_) => (640, 700),
|
||||
crate::ui::window::sheet_set::SsDialog::Form(f) => match f.kind {
|
||||
crate::ui::window::sheet_set::FormKind::Rename => (560, 470),
|
||||
crate::ui::window::sheet_set::FormKind::RenameView => (520, 200),
|
||||
crate::ui::window::sheet_set::FormKind::ImportLayout => (620, 470),
|
||||
_ => (560, 420),
|
||||
},
|
||||
crate::ui::window::sheet_set::SsDialog::Confirm(..) => (460, 190),
|
||||
crate::ui::window::sheet_set::SsDialog::Template(_) => (480, 400),
|
||||
crate::ui::window::sheet_set::SsDialog::Category(_) => (480, 440),
|
||||
crate::ui::window::sheet_set::SsDialog::BlockList(_) => (540, 330),
|
||||
crate::ui::window::sheet_set::SsDialog::SelectBlock(_) => (580, 390),
|
||||
};
|
||||
sized_flow(ex, w, h, |flow| crate::ui::window::sheet_set::dialog_view(&self.sheet_set, flow))
|
||||
}
|
||||
super::super::ModalKind::Field => {
|
||||
let state = self.field_dialog.as_ref()?;
|
||||
sized_flow(ex, 760, 660, |flow| crate::ui::window::field_dialog::view(state, flow))
|
||||
|
||||
Reference in new issue
Block a user