From 1061c4476337e2309d51dd9ea30de704228658b9 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 16 Oct 2026 03:48:21 +0000 Subject: [PATCH] Integration: #325 New Document: mobile presets don't turn on the primary text frame Primary Text Frame autoflow is still an open gap, and file.new {preset} goes through the same builder. The TABS doc comment goes back onto TABS; the de and ja rows of the removed "No saved presets yet" text go. --- crates/doc/src/build.rs | 2 -- crates/ui-egui/src/i18n/de.rs | 4 ---- crates/ui-egui/src/i18n/ja.rs | 4 ---- crates/ui-egui/src/new_document.rs | 6 +++--- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/crates/doc/src/build.rs b/crates/doc/src/build.rs index 54ab4856..f4482c4f 100644 --- a/crates/doc/src/build.rs +++ b/crates/doc/src/build.rs @@ -97,8 +97,6 @@ impl NewDocument { height: p.height, units: p.units, facing_pages: !web, - // As in InDesign: mobile presets start with a primary text frame. - primary_text_frame: p.intent == Intent::Mobile, margins: if p.units == Unit::Millimeters { Margins::uniform(12.7 * MM) } else { Margins::uniform(36.0) }, ..Default::default() }) diff --git a/crates/ui-egui/src/i18n/de.rs b/crates/ui-egui/src/i18n/de.rs index bde955e1..92ca341c 100644 --- a/crates/ui-egui/src/i18n/de.rs +++ b/crates/ui-egui/src/i18n/de.rs @@ -1756,10 +1756,6 @@ pub(super) const TABLE: &[(&str, &str)] = &[ ("Your Recent Items", "Zuletzt verwendete Elemente"), ("Saved Presets", "Gespeicherte Vorgaben"), ("Blank Document Presets", "Vorgaben für leere Dokumente"), - ( - "No saved presets yet. Set the details, then click Save Document Preset.", - "Noch keine gespeicherten Vorgaben. Legen Sie die Details fest und klicken Sie auf Dokumentvorgabe speichern.", - ), ("Delete Preset", "Vorgabe löschen"), ("Preset Details", "Vorgabedetails"), ("Document Name", "Dokumentname"), diff --git a/crates/ui-egui/src/i18n/ja.rs b/crates/ui-egui/src/i18n/ja.rs index de0d07ff..8bc4536d 100644 --- a/crates/ui-egui/src/i18n/ja.rs +++ b/crates/ui-egui/src/i18n/ja.rs @@ -1954,10 +1954,6 @@ pub(super) const TABLE: &[(&str, &str)] = &[ ("Your Recent Items", "最近使用した項目"), ("Saved Presets", "保存済みプリセット"), ("Blank Document Presets", "空のドキュメントプリセット"), - ( - "No saved presets yet. Set the details, then click Save Document Preset.", - "保存済みのプリセットはありません。詳細を設定してから「ドキュメントプリセットを保存」をクリックしてください。", - ), ("Delete Preset", "プリセットを削除"), ("Preset Details", "プリセットの詳細"), ("Document Name", "ドキュメント名"), diff --git a/crates/ui-egui/src/new_document.rs b/crates/ui-egui/src/new_document.rs index faf0a5df..4b99aa3b 100644 --- a/crates/ui-egui/src/new_document.rs +++ b/crates/ui-egui/src/new_document.rs @@ -14,10 +14,10 @@ use crate::DesignApp; use crate::dialogs::Dialog; use crate::theme::{Tokens, semibold}; -/// Tab key and English label. /// The Units list, as InDesign's New Document window has it. const NEW_DOCUMENT_UNITS: [Unit; 8] = [Unit::Points, Unit::Picas, Unit::Inches, Unit::Millimeters, Unit::Centimeters, Unit::Ciceros, Unit::Agates, Unit::Pixels]; +/// Tab key and English label. const TABS: [(&str, &str); 5] = [("recent", "Recent"), ("saved", "Saved"), ("print", "Print"), ("web", "Web"), ("mobile", "Mobile")]; /// The card of the factory settings, first on the Recent tab. const DEFAULT_CARD: &str = "[Default]"; @@ -984,11 +984,11 @@ mod tests { assert_eq!((d.s("width"), d.s("height"), units(d)), ("1920 px".into(), "1080 px".into(), Unit::Pixels), "Web is in pixels"); assert!(!d.b("facingPages") && !d.b("primaryTextFrame")); assert_eq!(d.s("name"), "Poster", "the typed name stays"); - // Mobile starts with a primary text frame, as in InDesign. + // Mobile is in pixels too. let texts = settle(&mut app, &ctx); click(&mut app, &ctx, tab(&texts, "Mobile"), 1); let d = app.ui.dialog.as_ref().unwrap(); - assert_eq!((d.s("tab"), units(d), d.b("primaryTextFrame")), ("mobile".into(), Unit::Pixels, true)); + assert_eq!((d.s("tab"), units(d)), ("mobile".into(), Unit::Pixels)); let texts = settle(&mut app, &ctx); click(&mut app, &ctx, tab(&texts, "Print"), 1); let d = app.ui.dialog.as_ref().unwrap();