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.
This commit is contained in:
aiongg
2026-10-16 03:48:21 +00:00
parent a59edb861a
commit 1061c44763
4 changed files with 3 additions and 13 deletions
-2
View File
@@ -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()
})
-4
View File
@@ -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"),
-4
View File
@@ -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", "ドキュメント名"),
+3 -3
View File
@@ -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();