feat(options): interface scale for the whole window

On a non-Retina screen macOS draws the interface at 1x, which reads small
on a Full HD monitor, and there was no way to enlarge it. Options >
Display now offers an interface scale of 75–200 % in 25 % steps, applied
through the window's scale factor on top of the display's own and kept
with the user settings. It is a list rather than a slider because the
dialog rescales under the pointer as the value changes.

Fixes #1655

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-08 14:41:46 +03:00
1 parent ff5bfc8c47
commit 340104bf1b
29 files changed
+65

No files matched your search

+6
View File
@@ -561,6 +561,8 @@ pub(super) struct OpenCADStudio {
zoom_wheel_reversed: bool,
/// Scroll pans and Ctrl+scroll zooms (touchpads); see `scroll_intent`.
touchpad_pan: bool,
/// Interface scale in percent, applied through the window scale factor.
ui_scale_percent: u16,
/// Mouse-wheel zoom sensitivity (ZOOMFACTOR), held inside
/// `settings::ZOOM_FACTOR_MIN..=settings::ZOOM_FACTOR_MAX`. `SETVAR`
/// only sets the range the system variable itself has; the Options
@@ -2378,6 +2380,8 @@ pub enum Message {
/// Toggle reversing the mouse-wheel zoom direction (ZOOMWHEEL).
ZoomWheelReversedChanged(bool),
TouchpadPanChanged(bool),
/// Interface scale in percent (Options > Display).
UiScaleChanged(u16),
/// Change how far one wheel notch zooms, from the Options slider
/// (ZOOMFACTOR).
ZoomFactorChanged(i32),
@@ -4161,6 +4165,7 @@ impl OpenCADStudio {
polar_increment_deg: 45.0,
zoom_wheel_reversed: false,
touchpad_pan: false,
ui_scale_percent: 100,
zoom_factor: 60,
zoom_factor_input: 60.to_string(),
cursor_size: 5,
@@ -4904,6 +4909,7 @@ pub fn run() -> iced::Result {
..iced::Settings::default()
})
.subscription(OpenCADStudio::subscription)
.scale_factor(|state: &OpenCADStudio, _| f32::from(state.ui_scale_percent) / 100.0)
.title(|state: &OpenCADStudio, window_id: window::Id| {
let _ = window_id; // all dialogs are in-canvas modals now
if let Some(tab) = state.tabs.get(state.active_tab) {