Allow smaller and larger interface scaling

This commit is contained in:
Dandaedre 2026-11-16 16:16:15 +01:00
parent 7e7155b5ba
commit a3faced905
5 changed files with 27 additions and 14 deletions

View File

@ -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"));
}

View File

@ -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),

View File

@ -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.

View File

@ -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.

View File

@ -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. |