| 374 | } |
| 375 | |
| 376 | fn object_context_ui(ui: &mut egui::Ui, object: &ObjectConfig) { |
| 377 | if let Some(source_path) = &object.source_path |
| 378 | && ui |
| 379 | .button("Open source file") |
| 380 | .on_hover_text("Open the source file in the default editor") |
| 381 | .clicked() |
| 382 | { |
| 383 | log::info!("Opening file {source_path}"); |
| 384 | if let Err(e) = open::that_detached(source_path.as_str()) { |
| 385 | log::error!("Failed to open source file: {e}"); |
| 386 | } |
| 387 | ui.close(); |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | #[derive(Default, Copy, Clone, PartialEq, Eq, Debug)] |
| 392 | enum NodeOpen { |