mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-24 10:16:59 -06:00
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:
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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", "ドキュメント名"),
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user