DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge remote-tracking branch 'origin/main' into table-convert-dialogs
moppeeer0937eea6e3bf
diff --cc crates/ui-egui/src/dialogs.rsindex 3388e106f,f6404c8ef..ee1d6f2b4--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@@ -32,10 -32,9 +32,11 @@@ impl Dialoglet defaults = match id {"newDocument" => crate::new_document::defaults(),"goToPage" => json!({"page": "1"}),+ "epubExport" => json!({"split": false, "mode": "style", "style": designcraft_doc::BASIC_PARAGRAPH}),"qrCode" => json!({"type": "url", "content": "https://", "color": "[Black]"}),"insertTable" => json!({"bodyRows": 4, "columns": 4, "headerRows": 0, "footerRows": 0}),+ "convertTextToTable" => json!({"columnSeparator": "tab", "rowSeparator": "paragraph", "columns": 1}),+ "convertTableToText" => json!({"columnSeparator": "tab", "rowSeparator": "paragraph"}),"insertXref" => json!({"linkTo": "paragraph", "style": "", "target": "", "format": ""}),"findChange" => json!({"find": "", "change": "", "grep": false, "caseSensitive": false, "wholeWord": false, "scope": "document"}),"documentSetup" => json!({}),diff --cc crates/ui-egui/src/menus.rsindex d8ba2a707,74fe860ea..497d99f92--- a/crates/ui-egui/src/menus.rs+++ b/crates/ui-egui/src/menus.rs@@@ -2528,15 -2559,9 +2581,18 @@@ pub fn menu_enabled(app: &DesignApp, idif id == "guide.selectAll" && (!app.ui.guides || app.ui.guides_locked) {return false;}+ // As InDesign's: Convert Text to Table wants selected text outside a table, Convert Table to+ // Text a table.+ if id == "app.convertTextToTableDialog" {+ let selected = app.session.active().and_then(|d| d.selection.text).is_some_and(|t| t.cell.is_none() && !t.is_caret());+ return selected && enabled(app, "table.convertFromText");+ }+ if id == "app.convertTableToTextDialog" {+ return enabled(app, "table.convertToText");+ }+ if id == "view.goBack" || id == "view.goForward" {+ return crate::canvas::can_go_through_history(app, if id == "view.goBack" { -1 } else { 1 });+ }if ui_label(id).is_some() {return app.session.active().is_some() || id.starts_with("app.") || id.starts_with("window.") || id.starts_with("help.");}