Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Integration: #325 New Document: mobile presets don't turn on the primary text frame

aiongg1061c4476337
diff --git a/crates/doc/src/build.rs b/crates/doc/src/build.rs
index 54ab48567..f4482c4fe 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 bde955e1f..92ca341c1 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 de0d07ff7..8bc4536da 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 faf0a5dfe..4b99aa3bf 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();