Skip to content

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

W: UI scaling preference (window.uiScale); title yields to crowded app bar

Brandon Thomas6383871c0526
diff --git a/ROADMAP.md b/ROADMAP.md
index 3c7544ef7..47bb46e0a 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -30,6 +30,7 @@ DesignCraft aims at full Adobe InDesign parity — and to be better: faster, ope
- Edit › Paste Into (copied objects become a frame's content, clipped by it; rendered, PDF and IDML both ways — verified in InDesign 2026); Polygon Settings (sides, star inset; double-click the Polygon tool).
- Color panel (fill/stroke proxy, CMYK/RGB/Lab sliders with channel ramps, tint slider for swatches, spectrum ramp, Add to Swatches) and Color Picker (double-click the proxy); mixed colours are unnamed (not listed in Swatches until added); `object.color`, `swatch.addToSwatches`, `swatch.addUnnamed`.
- Place text files: Word (.docx: styles by name with their attributes, bold/italic/underline/size/font, footnotes, tables, tabs, breaks), RTF and plain text, into the insertion point, the selected frame or a new frame; autoflow adds pages and threaded frames until the text fits; Remove Styles option (`designcraft-textimport`).
+- UI scaling (Preferences › Interface, 50–200%; `window.uiScale`); the window title steps aside when the bar is crowded.
- Underline / Strikethrough Options: weight, offset, colour and tint (Character panel; screen, PDF and IDML).
- Relink to Folder and Relink File Extension (`links.relinkFolder`; missing links found by name).
- File › Package (⌥⇧⌘P): the document relinked to a Links folder, the placed files, an IDML copy, an optional PDF and a report (fonts, links, preflight, instructions); Copy Links To (`links.copyTo`).
diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs
index 421b39274..6d557efac 100644
--- a/crates/ui-egui/src/chrome.rs
+++ b/crates/ui-egui/src/chrome.rs
@@ -19,6 +19,8 @@ pub fn app_bar(app: &mut DesignApp, ui: &mut egui::Ui) {
.frame(egui::Frame::NONE.fill(t.app_bar).inner_margin(egui::Margin { left, right: 10, top: 0, bottom: 7 }))
.show(ui, |ui| {
let full = ui.max_rect();
+ let mut menus_end = full.min.x;
+ let mut tools_start = full.max.x;
ui.horizontal_centered(|ui| {
if icons::button(ui, "home", 24.0, app.session.active().is_none(), "Home").clicked() {
app.session_home();
@@ -31,6 +33,7 @@ pub fn app_bar(app: &mut DesignApp, ui: &mut egui::Ui) {
ui.style_mut().spacing.button_padding = vec2(7.0, 3.0);
crate::menus::menu_bar(app, ui);
}
+ menus_end = ui.min_rect().max.x;
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
ui.add_space(4.0);
// Search field.
@@ -58,6 +61,7 @@ pub fn app_bar(app: &mut DesignApp, ui: &mut egui::Ui) {
if crate::about::discord_button(ui, "Discord", vec2(78.0, 22.0)) {
let _ = app.run("help.discord", json!({}));
}
+ tools_start = ui.min_rect().min.x;
});
});
// Centred title.
@@ -65,13 +69,13 @@ pub fn app_bar(app: &mut DesignApp, ui: &mut egui::Ui) {
Some(d) => format!("DesignCraft — {}", d.title()),
None => "DesignCraft".to_string(),
};
- ui.painter().text(
- egui::pos2(full.center().x, full.min.y + 18.0),
- egui::Align2::CENTER_CENTER,
- title,
- egui::FontId::proportional(11.5),
- t.text,
- );
+ // Centred between the menus and the right-hand controls; left out when it won't fit.
+ let galley = ui.painter().layout_no_wrap(title, egui::FontId::proportional(11.5), t.text);
+ let w = galley.size().x;
+ let cx = full.center().x;
+ if cx - w / 2.0 > menus_end + 12.0 && cx + w / 2.0 < tools_start - 12.0 {
+ ui.painter().galley(egui::pos2(cx - w / 2.0, full.min.y + 18.0 - galley.size().y / 2.0), galley, t.text);
+ }
});
let r = resp.response.rect;
ui.painter().rect_filled(egui::Rect::from_min_max(egui::pos2(r.min.x, r.max.y - 7.0), r.max), 0.0, t.pasteboard);
diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs
index 5b282d67f..468141c2a 100644
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@ -204,6 +204,7 @@ fn preferences(ui: &mut egui::Ui, d: &mut Dialog) {
let sections: &[(&str, &str)] = if has_doc {
&[
("general", "General"),
+ ("interface", "Interface"),
("type", "Type"),
("units", "Units & Increments"),
("grids", "Grids"),
@@ -211,7 +212,7 @@ fn preferences(ui: &mut egui::Ui, d: &mut Dialog) {
("display", "Display Performance"),
]
} else {
- &[("general", "General"), ("type", "Type"), ("display", "Display Performance")]
+ &[("general", "General"), ("interface", "Interface"), ("type", "Type"), ("display", "Display Performance")]
};
let cur = d.s("section");
ui.horizontal_top(|ui| {
@@ -234,6 +235,16 @@ fn preferences(ui: &mut egui::Ui, d: &mut Dialog) {
ui.label(egui::RichText::new("Type Options").font(semibold(12.0)));
check(ui, d, "typographersQuotes", "Use Typographer's Quotes");
}
+ "interface" => {
+ ui.label(egui::RichText::new("UI Scaling").font(semibold(12.0)));
+ ui.horizontal(|ui| {
+ ui.label("UI Size:");
+ let mut v = d.n("uiScale").unwrap_or(100.0);
+ if ui.add(egui::Slider::new(&mut v, 50.0..=200.0).step_by(5.0).suffix("%")).changed() {
+ d.fields.insert("uiScale".into(), json!(v));
+ }
+ });
+ }
"grids" => {
ui.label(egui::RichText::new("Baseline Grid").font(semibold(12.0)));
egui::Grid::new("pref_bg").num_columns(2).spacing([8.0, 6.0]).show(ui, |ui| {
@@ -700,6 +711,9 @@ pub fn confirm(app: &mut DesignApp) -> Result<Value, String> {
_ => "view.highQualityDisplay",
};
app.run(view, json!({}))?;
+ if let Some(v) = d.n("uiScale") {
+ app.run("window.uiScale", json!({"scale": v / 100.0}))?;
+ }
if !d.fields.contains_key("horizontalUnits") {
return Ok(Value::Null);
}
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index 6b5122ee4..746873b6e 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -85,6 +85,8 @@ pub struct UiState {
pub hidden_characters: bool,
/// View › Display Performance.
pub display_quality: designcraft_render::DisplayQuality,
+ /// Preferences › Interface › UI scaling (1 = 100%).
+ pub ui_scale: f32,
pub control_bar: bool,
pub tools_double_column: bool,
/// Expanded right-dock panel group tab.
@@ -133,6 +135,7 @@ impl Default for UiState {
text_threads: false,
hidden_characters: false,
display_quality: designcraft_render::DisplayQuality::High,
+ ui_scale: 1.0,
control_bar: false,
tools_double_column: false,
dock_tab: "properties".into(),
@@ -380,6 +383,10 @@ impl DesignApp {
/// Per-frame logic before layout.
pub fn logic(&mut self, ctx: &egui::Context) {
+ let scale = self.ui.ui_scale.clamp(0.5, 3.0);
+ if (ctx.zoom_factor() - scale).abs() > 1e-3 {
+ ctx.set_zoom_factor(scale);
+ }
if !self.styled {
theme::install_fonts(ctx);
self.styled = true;
diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs
index 89d8f4340..d7daad076 100644
--- a/crates/ui-egui/src/menus.rs
+++ b/crates/ui-egui/src/menus.rs
@@ -20,6 +20,7 @@ pub const UI_COMMANDS: &[(&str, &str, Option<&str>, &str)] = &[
("app.exportPdf", "Export PDF…", None, "{path?, …file.exportPdf options} — asks for a path when none is given"),
("app.palette", "Quick Apply…", Some("Cmd+Return"), "{} — search styles and commands"),
("app.preferences", "Preferences…", Some("Cmd+K"), "{}"),
+ ("window.uiScale", "UI Scaling", None, "{scale: 0.5–3 (1 = 100%)} — the size of the whole interface"),
("app.findChange", "Find/Change…", Some("Cmd+F"), "{}"),
("app.insertTableDialog", "Create Table…", None, "{} — Insert Table dialog (body/header/footer rows, columns)"),
("app.footnoteOptionsDialog", "Document Footnote Options…", None, "{} — numbering, formatting and layout of footnotes"),
@@ -623,6 +624,7 @@ pub fn run_ui(app: &mut DesignApp, id: &str, p: &Value) -> Option<Result<Value,
designcraft_render::DisplayQuality::Typical => "typical",
designcraft_render::DisplayQuality::High => "high",
});
+ f["uiScale"] = json!((app.ui.ui_scale * 100.0).round());
f["section"] = json!("general");
app.ui.dialog = Some(crate::dialogs::Dialog::new("preferences", f));
Ok(Value::Null)
@@ -706,6 +708,11 @@ pub fn run_ui(app: &mut DesignApp, id: &str, p: &Value) -> Option<Result<Value,
}
Ok(Value::Null)
}
+ "window.uiScale" => {
+ let v = p.get("scale").and_then(Value::as_f64).unwrap_or(1.0) as f32;
+ app.ui.ui_scale = v.clamp(0.5, 3.0);
+ Ok(json!({"scale": app.ui.ui_scale}))
+ }
"window.floatPanel" | "window.dockPanel" => {
let panel = p.get("panel").and_then(Value::as_str).unwrap_or("");
if !crate::dock::ICON_PANELS.iter().any(|(id, _, _)| *id == panel) {
diff --git a/docs/parity.md b/docs/parity.md
index 6e8dbd1c9..d25655e34 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -10,12 +10,12 @@ Each row of the InDesign feature catalogue is scored **D** (done), **P** (partia
| Priority | Features | Done | Partial | Missing | Parity |
|---|---|---|---|---|---|
| P0 | 102 | 99 | 3 | 0 | 99% |
-| P1 | 97 | 48 | 23 | 26 | 61% |
+| P1 | 97 | 49 | 23 | 25 | 62% |
| P2 | 76 | 8 | 7 | 61 | 15% |
| Area | Parity |
|---|---|
-| Application shell & workspace | 69% |
+| Application shell & workspace | 74% |
| Documents, pages, spreads | 71% |
| Layers | 95% |
| Frames, shapes & paths | 85% |
@@ -50,7 +50,7 @@ Open P0 items: Preferences, Vector/page formats (PDF/AI/SVG/EPS place), Export t
| Application shell & workspace | Properties panel | P0 | D |
| Application shell & workspace | Contextual task bar | P2 | D |
| Application shell & workspace | Themes | P0 | D |
-| Application shell & workspace | UI scaling | P1 | M |
+| Application shell & workspace | UI scaling | P1 | D |
| Application shell & workspace | Keyboard shortcut editor | P1 | M |
| Application shell & workspace | Menu customization | P2 | M |
| Application shell & workspace | Show Full Menus | P2 | M |