DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge remote-tracking branch 'origin/main' into linked-docx
Jeffrey Thayne999d0583a381
diff --cc ROADMAP.mdindex e916273e6,9f8168e50..ebd979700--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -127,9 -128,31 +128,32 @@@ list) · [roadmap.md](docs/roadmap.md)## Progress log+ - **2026-10-13** · Switching between document and parent pages refreshes the canvas immediately, preventing black parent pages and stale document objects when the zoom stays the same. Ordinary edits retain partial repainting. No readiness percentage change.+Newest first.+- **2026-10-12** · Linked text files (#597): placed Word, RTF and text files can stay linked; the Links panel shows them OK / Modified / Missing, and Update imports the file again into the same frames with the saved style map (the Links panel asks before replacing edits made in the layout). No readiness percentage change.+ - **2026-10-13** · Object › Fitting has InDesign's shortcuts: Fill Frame Proportionally ⌘⌥⇧C, Fit Content Proportionally ⌘⌥⇧E, Fit Frame to Content ⌘⌥C, Fit Content to Frame ⌘⌥E, Center Content ⌘⇧E. No readiness percentage change.+ - **2026-10-13** · Gradients between process colours blend as inks, as InDesign shows them: magenta to cyan passes through C 50 M 50 (a light lilac) on screen instead of the darker RGB mix, and a midpoint between CMYK or grey stops no longer turns the PDF shading RGB. No readiness percentage change.+ - **2026-10-14** · The Swatches panel has InDesign's header: a Fill/Stroke proxy, Formatting Affects Container/Text and the Tint of the colour in front (a tint alone keeps each object's own swatch). Clicking a swatch applies it to the fill or stroke in front (of the text, when formatting affects text), and the bottom row has New Color Group, New Swatch and Delete Swatch. No readiness percentage change.+ - **2026-10-14** · With the Page tool, the Control panel shows the page as InDesign's does: W/H from a reference point, page-size preset (US Business Card added), orientation, Liquid Page Rule (now with Controlled by Parent) and Show Parent Page Overlay, which draws the parent page's size over a resized page. No readiness percentage change.+ - **2026-10-14** · On an object-based page the Page tool shows a selected object's liquid pins and resize locks as InDesign does: a click pins a side to the page edge or locks the width or height, with InDesign's tooltips. No readiness percentage change.+ - **2026-10-14** · The Liquid Layout panel follows InDesign's: Liquid Page Rule with the page number, Content › Auto-Fit, and Object Constraints › Resize with Page and Pin for the selected object on an object-based page; Create Alternate Layout moved to the Layout menu. No readiness percentage change.+ - **2026-10-14** · With the Page tool, the Control panel shows the page as InDesign's does: W/H from a reference point, page-size preset (US Business Card added), orientation, Liquid Page Rule (now with Controlled by Parent) and Show Parent Page Overlay, which draws the parent page's size over a resized page. No readiness percentage change.+ - **2026-10-14** · With the Page tool, the Control panel shows the page as InDesign's does: W/H from a reference point, page-size preset (US Business Card added), orientation, Liquid Page Rule and Show Parent Page Overlay, which draws the parent page's size over a resized page. No readiness percentage change.+ - **2026-10-14** · The Page tool works as InDesign's: a click selects a page and shows its handles and liquid page rule; dragging a handle previews the rule and springs back, Alt-drag resizes the page from the opposite edge, Shift keeps proportions, with a W/H readout. No readiness percentage change.+ - **2026-10-14** · With the Page tool, a guide dragged from a ruler is a liquid guide (dashed), as in InDesign; guide-based pages stretch the objects it crosses. No readiness percentage change.+ - **2026-10-14** · The Pages panel menu follows InDesign's order: Insert Pages…, Move Pages…, Duplicate Spread (and at End of Document), Delete Page/Spread, New Parent…, Apply Parent to Pages, Override All Parent Page Items, Parent Pages, Create Alternate Layout…, Numbering & Section Options…, Allow Selected Spread to Shuffle. No readiness percentage change.+ - **2026-10-14** · Pages panel: Alt-drag copies a page, a page dropped on Create new page is duplicated at the end, Edit page size offers the presets and Custom Page Size…; duplicated pages keep their own size, rule and guides; thumbnails of pages of their own size stay in their rows. No readiness percentage change.+ - **2026-10-12** · Text threads by hand: click a selected text frame's in or out port to load+ the text cursor, then click a frame to thread it, click empty space for a column-wide frame or+ drag one (it snaps like frame drawing); Shift-click autoflows, Alt-click stays loaded on the+ frame just added; click the linked frame or double-click a port to break the thread.+ `text.thread`, `text.unthread`, `text.removeFromThread` with undo; locked frames and layers+ refuse threads. The alpha gate now waits only on the Primary Text Frame page fixes (#165). No+ readiness percentage change.+ - **2026-10-13** · Layout ▸ Table of Contents opens a real dialog: title and title style, Include Paragraph Styles and Other Styles lists with Add and Remove, and per style its entry style, page number position (after, before, none), separator and level. Replace Existing regenerates the current table of contents in place; otherwise OK makes a new frame on the page in view. IDML export writes the definition as a TOC style that import reads back, so Update works after a round trip. No readiness percentage change.+ - **2026-10-13** · Control-channel clicks and drags validate positive counts and the complete pending-event budget before queuing input (#732). Oversized requests leave pending gestures intact, preventing unbounded click-count allocation. No readiness percentage change.- **2026-10-12** · macOS Dock Quit uses the same unsaved-document prompts as window and menu Quit. Repeated requests keep the current answers; Cancel retains every tab and unsaved recovery checkpoint, and completed Save/Don't Save answers exit through the ordinary event loop. No readiness percentage change.- **2026-10-12** · Orderly native exit writes the latest recovery state after finalizing current quit approvals; incomplete or stale plans keep their documents, and Undo to the saved state clears stale recovery. Unavailable or failed recovery is reported. Cancelable macOS Dock Quit remains open (#544). No readiness percentage change.- **2026-10-12** · Recovered documents keep a checkpoint until saved, closed or reverted, including a second crash before autosave. Restarted document IDs and explicit recovery folders preserve other snapshots; failed republishing retains the original. No readiness percentage change.diff --cc crates/ui-egui/src/dialogs.rsindex 05076fc0d,3aef89f50..5afca2525--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@@ -1454,270 -1599,224 +1603,236 @@@ pub fn show(app: &mut DesignApp, ctx: &}}});- ui.end_row();- }- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Intent:"));- let cur = d.s("intent");- egui::ComboBox::from_id_salt("ws_intent")- .selected_text(crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, designcraft_color::cms::Intent::parse(&cur).map_or("", |i| i.label()))))- .show_ui(ui, |ui| {- for i in designcraft_color::cms::Intent::ALL {- if ui.selectable_label(i.id() == cur, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, i.label()))).clicked() {- d.fields.insert("intent".into(), json!(i.id()));+ crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Style Mapping")).font(semibold(12.0)));+ let names: Vec<String> =+ app.session.active().map(|s| s.doc.styles.paragraph.iter().map(|p| p.name.clone()).collect()).unwrap_or_default();+ let imported: Vec<String> = d+ .fields+ .get("styles")+ .and_then(Value::as_array)+ .map(|a| a.iter().filter_map(|v| v.as_str().map(str::to_string)).collect())+ .unwrap_or_default();+ egui::ScrollArea::vertical().max_height(180.0).show(ui, |ui| {+ egui::Grid::new("imp_map").num_columns(2).spacing([8.0, 4.0]).show(ui, |ui| {+ for w in &imported {+ ui.label(w);+ let mapped = d.fields.get("map").and_then(|m| m.get(w)).and_then(Value::as_str).unwrap_or("").to_string();+ let shown = if mapped.is_empty() { "(import)".to_string() } else { mapped.clone() };+ egui::ComboBox::from_id_salt(("imp_map", w)).selected_text(crate::rtl::widget(ui, &shown)).width(170.0).show_ui(+ ui,+ |ui| {+ if ui+ .selectable_label(+ mapped.is_empty(),+ crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "(import)")),+ )+ .clicked()+ && let Some(m) = d.fields.get_mut("map").and_then(Value::as_object_mut)+ {+ m.remove(w);+ }+ for n in &names {+ if ui.selectable_label(*n == mapped, n).clicked()+ && let Some(m) = d.fields.get_mut("map").and_then(Value::as_object_mut)+ {+ m.insert(w.clone(), json!(n));+ }+ }+ },+ );+ ui.end_row();}- }+ });});- ui.end_row();- });- check(ui, &mut d, "bpc", crate::i18n::tr(&app.ui.language, "Use Black Point Compensation"));- if ui.button(crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Load Profile…"))).clicked()- && let Some(path) = app.services.pick_open.as_mut().and_then(|f| f("icc"))- {- match app.session.execute("color.loadProfile", &json!({"path": path})) {- Ok(_) => {- let f = app.session.execute("color.settings", &json!({})).unwrap_or_default();- d.fields.insert("profiles".into(), f["profiles"].clone());- }- Err(e) => app.status(format!("Color Settings: {e}")),}}- }- "keyboardShortcuts" => keyboard_shortcuts(app, ui, &mut d),- "userDictionary" => user_dictionary(app, ui, &mut d),- "menus" => {- text_field(ui, &mut d, "query", 260.0);- let q = d.s("query").to_lowercase();- egui::ScrollArea::vertical().max_height(320.0).show(ui, |ui| {- for (menu, label) in crate::menus::all_menu_items().into_iter().filter(|(m, l)| q.is_empty() || m.to_lowercase().contains(&q) || l.to_lowercase().contains(&q)) {- let key = crate::menus::menu_key(&menu, &label);- let mut visible = !app.ui.hidden_menu_items.contains(&key);- if ui.checkbox(&mut visible, crate::rtl::widget(ui, format!("{} › {}", crate::i18n::tr(&app.ui.language, &menu), crate::i18n::tr(&app.ui.language, &label)))).changed() {- let _ = app.run("window.hideMenuItem", json!({"item": key, "hidden": !visible}));- }- }- });- }- "importOptions" => {- ui.label(egui::RichText::new(d.s("path")).size(10.5));- check(ui, &mut d, "removeStyles", crate::i18n::tr(&app.ui.language, "Remove Styles and Formatting from Text and Tables"));- if !d.b("removeStyles") {- crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Style Name Conflicts")).font(semibold(12.0)));- let conflicts: Vec<String> = d.fields.get("conflicts").and_then(Value::as_array).map(|a| a.iter().filter_map(|v| v.as_str().map(str::to_string)).collect()).unwrap_or_default();- ui.label(if conflicts.is_empty() { crate::i18n::tr(&app.ui.language, "No conflicts").to_string() } else { format!("{} conflict(s): {}", conflicts.len(), conflicts.join(", ")) });- let cur = d.s("styleConflicts");+ "closeDocument" => {+ let text = crate::i18n::tr(&app.ui.language, "“{}” has changes that are not saved. Save them before closing?")+ .replace("{}", &d.s("title"));+ crate::rtl::label(ui, text);+ }++ "updateLink" => {++ let text = crate::i18n::tr(++ &app.ui.language,++ "“{}” has been edited in this layout. Updating replaces those edits with the text from the file.",++ )++ .replace("{}", &d.s("files"));++ crate::rtl::label(ui, text);++ }+ "newWorkspace" => {+ ui.horizontal(|ui| {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Name:"));+ text_field(ui, &mut d, "name", 220.0);+ });+ crate::rtl::label(+ ui,+ egui::RichText::new(crate::i18n::tr(&app.ui.language, "Saves which bars show and where the panels are.")).size(10.5),+ );+ }+ "fittingOptions" => {+ check(ui, &mut d, "autoFit", crate::i18n::tr(&app.ui.language, "Auto-Fit"));+ ui.add_space(4.0);+ crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Content Fitting")).font(semibold(12.0)));+ let cur = d.s("fitting");+ let label = |v: &str| match v {+ "fillProportionally" => crate::i18n::tr(&app.ui.language, "Fill Frame Proportionally"),+ "fitProportionally" => crate::i18n::tr(&app.ui.language, "Fit Content Proportionally"),+ "fitContentToFrame" => crate::i18n::tr(&app.ui.language, "Fit Content to Frame"),+ "centerContent" => crate::i18n::tr(&app.ui.language, "Center Content"),+ _ => crate::i18n::tr(&app.ui.language, "None"),+ };ui.horizontal(|ui| {- for (v, l) in [("useExisting", "Use Document Style Definition"), ("redefine", "Redefine Document Style"), ("autoRename", "Auto Rename")] {- if ui.radio(cur == v, l).clicked() {- d.fields.insert("styleConflicts".into(), json!(v));+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Fitting:"));+ egui::ComboBox::from_id_salt("ff_fit").selected_text(crate::rtl::widget(ui, label(&cur))).width(200.0).show_ui(ui, |ui| {+ for v in ["none", "fillProportionally", "fitProportionally", "fitContentToFrame", "centerContent"] {+ if ui.selectable_label(cur == v, crate::rtl::widget(ui, label(v))).clicked() {+ d.fields.insert("fitting".into(), json!(v));+ }}- }+ });});- crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Style Mapping")).font(semibold(12.0)));- let names: Vec<String> = app.session.active().map(|s| s.doc.styles.paragraph.iter().map(|p| p.name.clone()).collect()).unwrap_or_default();- let imported: Vec<String> = d.fields.get("styles").and_then(Value::as_array).map(|a| a.iter().filter_map(|v| v.as_str().map(str::to_string)).collect()).unwrap_or_default();- egui::ScrollArea::vertical().max_height(180.0).show(ui, |ui| {- egui::Grid::new("imp_map").num_columns(2).spacing([8.0, 4.0]).show(ui, |ui| {- for w in &imported {- ui.label(w);- let mapped = d.fields.get("map").and_then(|m| m.get(w)).and_then(Value::as_str).unwrap_or("").to_string();- let shown = if mapped.is_empty() { "(import)".to_string() } else { mapped.clone() };- egui::ComboBox::from_id_salt(("imp_map", w)).selected_text(crate::rtl::widget(ui, &shown)).width(170.0).show_ui(ui, |ui| {- if ui.selectable_label(mapped.is_empty(),crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "(import)"))).clicked()- && let Some(m) = d.fields.get_mut("map").and_then(Value::as_object_mut)- {- m.remove(w);+ ui.horizontal(|ui| {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Align From:"));+ let a = d.n("align").unwrap_or(4.0) as u8;+ egui::Grid::new("ff_align").spacing([2.0, 2.0]).show(ui, |ui| {+ for row in 0..3u8 {+ for col in 0..3u8 {+ let i = row * 3 + col;+ let (r, resp) = ui.allocate_exact_size(egui::vec2(14.0, 14.0), egui::Sense::click());+ let c = ui.visuals().text_color();+ if a == i {+ ui.painter().rect_filled(r.shrink(2.0), 1.0, c);+ } else {+ ui.painter().rect_stroke(r.shrink(3.0), 1.0, egui::Stroke::new(1.0, c), egui::StrokeKind::Inside);}- for n in &names {- if ui.selectable_label(*n == mapped, n).clicked()- && let Some(m) = d.fields.get_mut("map").and_then(Value::as_object_mut)- {- m.insert(w.clone(), json!(n));- }+ if resp.clicked() {+ d.fields.insert("align".into(), json!(i));}- });+ }ui.end_row();}});});- }- }- "closeDocument" => {- let text = crate::i18n::tr(&app.ui.language, "“{}” has changes that are not saved. Save them before closing?").replace("{}", &d.s("title"));- crate::rtl::label(ui, text);- }- "updateLink" => {- let text = crate::i18n::tr(&app.ui.language, "“{}” has been edited in this layout. Updating replaces those edits with the text from the file.")- .replace("{}", &d.s("files"));- crate::rtl::label(ui, text);- }- "newWorkspace" => {- ui.horizontal(|ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Name:"));- text_field(ui, &mut d, "name", 220.0);- });- crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Saves which bars show and where the panels are.")).size(10.5));- }- "fittingOptions" => {- check(ui, &mut d, "autoFit", crate::i18n::tr(&app.ui.language, "Auto-Fit"));- ui.add_space(4.0);- crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Content Fitting")).font(semibold(12.0)));- let cur = d.s("fitting");- let label = |v: &str| match v {- "fillProportionally" => crate::i18n::tr(&app.ui.language, "Fill Frame Proportionally"),- "fitProportionally" => crate::i18n::tr(&app.ui.language, "Fit Content Proportionally"),- "fitContentToFrame" => crate::i18n::tr(&app.ui.language, "Fit Content to Frame"),- "centerContent" => crate::i18n::tr(&app.ui.language, "Center Content"),- _ => crate::i18n::tr(&app.ui.language, "None"),- };- ui.horizontal(|ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Fitting:"));- egui::ComboBox::from_id_salt("ff_fit").selected_text(crate::rtl::widget(ui, label(&cur))).width(200.0).show_ui(ui, |ui| {- for v in ["none", "fillProportionally", "fitProportionally", "fitContentToFrame", "centerContent"] {- if ui.selectable_label(cur == v, crate::rtl::widget(ui, label(v))).clicked() {- d.fields.insert("fitting".into(), json!(v));- }+ crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Crop Amount")).font(semibold(12.0)));+ egui::Grid::new("ff_crop").num_columns(4).spacing([8.0, 6.0]).show(ui, |ui| {+ for (k, l) in [("cropTop", "Top:"), ("cropLeft", "Left:")] {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, l));+ text_field(ui, &mut d, k, 70.0);}+ ui.end_row();+ for (k, l) in [("cropBottom", "Bottom:"), ("cropRight", "Right:")] {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, l));+ text_field(ui, &mut d, k, 70.0);+ }+ ui.end_row();});- });- ui.horizontal(|ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Align From:"));- let a = d.n("align").unwrap_or(4.0) as u8;- egui::Grid::new("ff_align").spacing([2.0, 2.0]).show(ui, |ui| {- for row in 0..3u8 {- for col in 0..3u8 {- let i = row * 3 + col;- let (r, resp) = ui.allocate_exact_size(egui::vec2(14.0, 14.0), egui::Sense::click());- let c = ui.visuals().text_color();- if a == i {- ui.painter().rect_filled(r.shrink(2.0), 1.0, c);- } else {- ui.painter().rect_stroke(r.shrink(3.0), 1.0, egui::Stroke::new(1.0, c), egui::StrokeKind::Inside);- }- if resp.clicked() {- d.fields.insert("align".into(), json!(i));+ }+ "qrCode" => {+ let cur = d.s("type");+ ui.horizontal(|ui| {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Type:"));+ let label = |v: &str| match v {+ "text" => crate::i18n::tr(&app.ui.language, "Plain Text"),+ "sms" => crate::i18n::tr(&app.ui.language, "Text Message"),+ "email" => crate::i18n::tr(&app.ui.language, "Email"),+ "vcard" => crate::i18n::tr(&app.ui.language, "Business Card"),+ _ => crate::i18n::tr(&app.ui.language, "Web Hyperlink"),+ };+ egui::ComboBox::from_id_salt("qr_type").selected_text(crate::rtl::widget(ui, label(&cur))).width(160.0).show_ui(ui, |ui| {+ for v in ["url", "text", "sms", "email", "vcard"] {+ if ui.selectable_label(cur == v, crate::rtl::widget(ui, label(v))).clicked() {+ d.fields.insert("type".into(), json!(v));}}- ui.end_row();- }+ });});- });- crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Crop Amount")).font(semibold(12.0)));- egui::Grid::new("ff_crop").num_columns(4).spacing([8.0, 6.0]).show(ui, |ui| {- for (k, l) in [("cropTop", "Top:"), ("cropLeft", "Left:")] {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, l));- text_field(ui, &mut d, k, 70.0);- }- ui.end_row();- for (k, l) in [("cropBottom", "Bottom:"), ("cropRight", "Right:")] {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, l));- text_field(ui, &mut d, k, 70.0);- }- ui.end_row();- });- }- "qrCode" => {- let cur = d.s("type");- ui.horizontal(|ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Type:"));- let label = |v: &str| match v {- "text" => crate::i18n::tr(&app.ui.language, "Plain Text"),- "sms" => crate::i18n::tr(&app.ui.language, "Text Message"),- "email" => crate::i18n::tr(&app.ui.language, "Email"),- "vcard" => crate::i18n::tr(&app.ui.language, "Business Card"),- _ => crate::i18n::tr(&app.ui.language, "Web Hyperlink"),+ let fields: &[(&str, &str)] = match cur.as_str() {+ "sms" => &[("number", "Cell Number:"), ("message", "Message:")],+ "email" => &[("to", "Email Address:"), ("subject", "Subject:"), ("body", "Message:")],+ "vcard" => &[("name", "Name:"), ("org", "Organization:"), ("phone", "Phone:"), ("email", "Email:"), ("url", "URL:")],+ "text" => &[("content", "Text:")],+ _ => &[("content", "URL:")],};- egui::ComboBox::from_id_salt("qr_type").selected_text(crate::rtl::widget(ui, label(&cur))).width(160.0).show_ui(ui, |ui| {- for v in ["url", "text", "sms", "email", "vcard"] {- if ui.selectable_label(cur == v, crate::rtl::widget(ui, label(v))).clicked() {- d.fields.insert("type".into(), json!(v));- }+ egui::Grid::new("qr_fields").num_columns(2).spacing([8.0, 6.0]).show(ui, |ui| {+ for (k, l) in fields {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, l));+ text_field(ui, &mut d, k, 260.0);+ ui.end_row();}+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Color:"));+ text_field(ui, &mut d, "color", 160.0);+ ui.end_row();});- });- let fields: &[(&str, &str)] = match cur.as_str() {- "sms" => &[("number", "Cell Number:"), ("message", "Message:")],- "email" => &[("to", "Email Address:"), ("subject", "Subject:"), ("body", "Message:")],- "vcard" => &[("name", "Name:"), ("org", "Organization:"), ("phone", "Phone:"), ("email", "Email:"), ("url", "URL:")],- "text" => &[("content", "Text:")],- _ => &[("content", "URL:")],- };- egui::Grid::new("qr_fields").num_columns(2).spacing([8.0, 6.0]).show(ui, |ui| {- for (k, l) in fields {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, l));- text_field(ui, &mut d, k, 260.0);+ }+ "polygonSettings" => {+ egui::Grid::new("poly").num_columns(2).spacing([8.0, 6.0]).show(ui, |ui| {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Number of Sides:"));+ text_field(ui, &mut d, "sides", 60.0);ui.end_row();- }- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Color:"));- text_field(ui, &mut d, "color", 160.0);- ui.end_row();- });- }- "polygonSettings" => {- egui::Grid::new("poly").num_columns(2).spacing([8.0, 6.0]).show(ui, |ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Number of Sides:"));- text_field(ui, &mut d, "sides", 60.0);- ui.end_row();- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Star Inset:"));+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Star Inset:"));+ ui.horizontal(|ui| {+ text_field(ui, &mut d, "starInset", 60.0);+ ui.label("%");+ });+ ui.end_row();+ });+ }+ STEP_AND_REPEAT => step_and_repeat_dialog(app, ui, &mut d),+ TOC => toc_dialog(app, ui, &mut d),+ id if id.starts_with("cmd:") => command_form(app, ui, &mut d),+ "goToPage" => {ui.horizontal(|ui| {- text_field(ui, &mut d, "starInset", 60.0);- ui.label("%");+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Page"));+ text_field(ui, &mut d, "page", 80.0);});- ui.end_row();- });- }- STEP_AND_REPEAT => step_and_repeat_dialog(app, ui, &mut d),- id if id.starts_with("cmd:") => command_form(app, ui, &mut d),- "goToPage" => {- ui.horizontal(|ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Page"));- text_field(ui, &mut d, "page", 80.0);- });- }- "ruby" => {- ui.horizontal(|ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Ruby:"));- text_field(ui, &mut d, "text", 200.0);- });- crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Set over the selected text; empty removes it.")).size(11.0));- }- "insertTable" => {- crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Table Dimensions")).font(semibold(12.0)));- egui::Grid::new("ins_table").num_columns(4).spacing([8.0, 6.0]).show(ui, |ui| {- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Body Rows"));- text_field(ui, &mut d, "bodyRows", 60.0);- crate::rtl::label(ui, crate::i18n::tr_context(&app.ui.language, "Columns", "table"));- text_field(ui, &mut d, "columns", 60.0);- ui.end_row();- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Header Rows"));- text_field(ui, &mut d, "headerRows", 60.0);- crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Footer Rows"));- text_field(ui, &mut d, "footerRows", 60.0);- ui.end_row();- });- }- "textFrameOptions" => {- seed_text_frame_options(app, &mut d);- text_frame_options_dialog(app, ui, &mut d);- }- "documentSetup" => document_setup(app, ui, &mut d),- "pdfExport" => pdf_export(app, ui, &mut d),- "alert" => {- let file = d.s("file");- if !file.is_empty() {- crate::rtl::label(ui, egui::RichText::new(crate::rtl::isolate(&file)).font(semibold(13.0)));- ui.add_space(4.0);}- crate::rtl::label(ui, d.s("message"));- }- _ => {}- }- });+ "ruby" => {+ ui.horizontal(|ui| {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Ruby:"));+ text_field(ui, &mut d, "text", 200.0);+ });+ crate::rtl::label(+ ui,+ egui::RichText::new(crate::i18n::tr(&app.ui.language, "Set over the selected text; empty removes it.")).size(11.0),+ );+ }+ "insertTable" => {+ crate::rtl::label(ui, egui::RichText::new(crate::i18n::tr(&app.ui.language, "Table Dimensions")).font(semibold(12.0)));+ egui::Grid::new("ins_table").num_columns(4).spacing([8.0, 6.0]).show(ui, |ui| {+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Body Rows"));+ text_field(ui, &mut d, "bodyRows", 60.0);+ crate::rtl::label(ui, crate::i18n::tr_context(&app.ui.language, "Columns", "table"));+ text_field(ui, &mut d, "columns", 60.0);+ ui.end_row();+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Header Rows"));+ text_field(ui, &mut d, "headerRows", 60.0);+ crate::rtl::label(ui, crate::i18n::tr(&app.ui.language, "Footer Rows"));+ text_field(ui, &mut d, "footerRows", 60.0);+ ui.end_row();+ });+ }+ "textFrameOptions" => {+ seed_text_frame_options(app, &mut d);+ text_frame_options_dialog(app, ui, &mut d);+ }+ "documentSetup" => document_setup(app, ui, &mut d),+ "pdfExport" => pdf_export(app, ui, &mut d),+ "alert" => {+ let file = d.s("file");+ if !file.is_empty() {+ crate::rtl::label(ui, egui::RichText::new(crate::rtl::isolate(&file)).font(semibold(13.0)));+ ui.add_space(4.0);+ }+ crate::rtl::label(ui, d.s("message"));+ }+ _ => {}+ });ui.add_space(12.0);- let ok_label = if d.id == "closeDocument" { " Save " } else { " OK " };+ let ok_label = match d.id.as_str() {+ "closeDocument" => " Save ",+ "updateLink" => " Update ",+ _ => " OK ",+ };ui.horizontal(|ui| {ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {if ui