From a3faced90591548a48276079512cfcfc3363234b Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Mon, 16 Nov 2026 16:16:15 +0100 Subject: [PATCH] Allow smaller and larger interface scaling --- crates/canvas-pilot/src/preferences_ui.rs | 4 ++-- crates/canvas-pilot/src/settings.rs | 21 ++++++++++++++++----- docs/canvas-pilot/changelog.md | 2 +- docs/canvas-pilot/guide/preferences.md | 10 ++++++---- docs/interfaces/canvas-pilot-settings.md | 4 ++-- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/crates/canvas-pilot/src/preferences_ui.rs b/crates/canvas-pilot/src/preferences_ui.rs index b9cae63..13227f2 100644 --- a/crates/canvas-pilot/src/preferences_ui.rs +++ b/crates/canvas-pilot/src/preferences_ui.rs @@ -171,7 +171,7 @@ impl Editor { let scaling_before = (self.ui_scale, self.text_scale); let mut percent = self.ui_scale * 100.0; ui.label(tr(ctx, "access.interface-scale")); - ui.add(egui::Slider::new(&mut percent, 100.0..=200.0).suffix(" %").step_by(5.0)); + ui.add(egui::Slider::new(&mut percent, 50.0..=400.0).suffix(" %").step_by(5.0)); self.ui_scale = percent / 100.0; let mut separate = self.text_scale.is_some(); if ui.checkbox(&mut separate, tr(ctx, "access.text-scale")).changed() { @@ -179,7 +179,7 @@ impl Editor { } if let Some(scale) = &mut self.text_scale { let mut percent = *scale * 100.0; - ui.add(egui::Slider::new(&mut percent, 100.0..=150.0).suffix(" %").step_by(5.0)); + ui.add(egui::Slider::new(&mut percent, 50.0..=200.0).suffix(" %").step_by(5.0)); *scale = percent / 100.0; ui.weak(tr(ctx, "access.text-help")); } diff --git a/crates/canvas-pilot/src/settings.rs b/crates/canvas-pilot/src/settings.rs index ae13429..1681d4f 100644 --- a/crates/canvas-pilot/src/settings.rs +++ b/crates/canvas-pilot/src/settings.rs @@ -149,12 +149,12 @@ impl Settings { return Err(format!("unsupported settings version {}", self.version)); } if !self.ui_scale.is_finite() - || !(1.0..=2.0).contains(&self.ui_scale) + || !(0.5..=4.0).contains(&self.ui_scale) || self .text_scale - .is_some_and(|scale| !scale.is_finite() || !(1.0..=1.5).contains(&scale)) + .is_some_and(|scale| !scale.is_finite() || !(0.5..=2.0).contains(&scale)) { - return Err("Interface scale must be 100–200%; text scale must be 100–150%".into()); + return Err("Interface scale must be 50–400%; text scale must be 50–200%".into()); } if self.recent_midra_hosts.len() > 4 || self.recent_midra_hosts.iter().enumerate().any(|(i, host)| { @@ -306,7 +306,18 @@ mod tests { Settings::parse(&serde_json::to_string(&saved).unwrap()).unwrap(), saved ); - for scale in [0.5, 2.1, f32::NAN, f32::INFINITY] { + for (ui_scale, text_scale) in [(0.5, 0.5), (4.0, 2.0)] { + let boundary = Settings { + ui_scale, + text_scale: Some(text_scale), + ..saved.clone() + }; + assert_eq!( + Settings::parse(&serde_json::to_string(&boundary).unwrap()).unwrap(), + boundary + ); + } + for scale in [0.49, 4.01, f32::NAN, f32::INFINITY] { assert!( Settings { ui_scale: scale, @@ -316,7 +327,7 @@ mod tests { .is_err() ); } - for scale in [0.5, 1.6, f32::NAN] { + for scale in [0.49, 2.01, f32::NAN] { assert!( Settings { text_scale: Some(scale), diff --git a/docs/canvas-pilot/changelog.md b/docs/canvas-pilot/changelog.md index dd37290..69bbacf 100644 --- a/docs/canvas-pilot/changelog.md +++ b/docs/canvas-pilot/changelog.md @@ -6,7 +6,7 @@ ### v0.9.1 -- Added Appearance controls for 100–200% interface zoom and optional 100–150% +- Added Appearance controls for 50–400% interface zoom and optional 50–200% standard-widget text scaling, with a readily accessible size reset. Added a High Contrast theme with measured text contrast and stronger widget borders. Settings v11 migrates older preferences without changing projects or exports. diff --git a/docs/canvas-pilot/guide/preferences.md b/docs/canvas-pilot/guide/preferences.md index 09fcca5..f111ce7 100644 --- a/docs/canvas-pilot/guide/preferences.md +++ b/docs/canvas-pilot/guide/preferences.md @@ -53,15 +53,17 @@ language preferences to another workstation. Open **Menu → Open all settings… → Appearance**: -- **Interface scale:** enlarge the entire interface from **100% to 200%**, on top - of the operating system's display scale. This also enlarges icons and hit targets. -- **Adjust text separately:** optionally enlarge standard control text by a further - **100% to 150%**. Canvas artwork and fixed-size labels follow interface scale only. +- **Interface scale:** resize the entire interface from **50% to 400%**, on top + of the operating system's display scale. This also scales icons and hit targets. +- **Adjust text separately:** optionally scale standard control text by an additional + **50% to 200%**. Canvas artwork and fixed-size labels follow interface scale only. - **Use high contrast:** select a black-based theme with white text, bright accents and stronger control borders. It also appears as **High Contrast** in the theme browser. Changes apply immediately and are remembered on this computer. **Reset interface size**, near the top of Settings, restores 100% and disables separate text scaling. +Smaller scales free up space on low-resolution displays; larger scales support +high-resolution monitors. These ranges do not depend on monitor resolution. The settings content scrolls at smaller window sizes. Larger windows provide more working space at high zoom. Project dimensions, exported artwork, clipboard data and device values stay unchanged; imported pictures retain their original colors. diff --git a/docs/interfaces/canvas-pilot-settings.md b/docs/interfaces/canvas-pilot-settings.md index 03a404b..a9279c9 100644 --- a/docs/interfaces/canvas-pilot-settings.md +++ b/docs/interfaces/canvas-pilot-settings.md @@ -27,8 +27,8 @@ unknown theme names are rejected. There are no numeric coordinates or units. | Field | Values / default | | --- | --- | | `version` | Integer `11` | -| `ui_scale` | Finite number, 1.0–2.0 inclusive; default 1.0. egui interface zoom relative to the OS display scale. | -| `text_scale` | `null` (default, disabled) or finite number 1.0–1.5 inclusive. Additional standard-widget text multiplier. | +| `ui_scale` | Finite number, 0.5–4.0 inclusive; default 1.0. egui interface zoom relative to the OS display scale. | +| `text_scale` | `null` (default, disabled) or finite number 0.5–2.0 inclusive. Additional standard-widget text multiplier. | | `language` | `"system"` (default), `"en"`, `"fr"`, `"ja"`, `"zh-CN"`, `"es"`, `"grc"`, `"eo"`. Unknown values are rejected. | | `autoconnect_at_startup` | Boolean; default false. Try one background connection at application startup if the saved address is nonblank. | | `allow_sending_to_program` | Boolean; default false. Enables the Program destination in the exporter. Turning it off restores Preview; applies to quick Apply too. |