forked from 1b-agent/opencadstudio-upstream
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:
1 parent
ff5bfc8c47
commit
340104bf1b
29 files changed
+65
No files matched your search
@@ -183,6 +183,11 @@ pub const ZOOM_FACTOR_MAX: i32 = 500;
|
||||
/// Hold a ZOOMFACTOR inside the range the application can store, wherever it
|
||||
/// arrives from — the slider, the Options field, or a configuration file
|
||||
/// written by hand or by an older build.
|
||||
/// Interface scale in percent, kept to the range the Options slider offers.
|
||||
pub fn clamp_ui_scale(percent: u16) -> u16 {
|
||||
percent.clamp(75, 200)
|
||||
}
|
||||
|
||||
pub fn clamp_zoom_factor(v: i32) -> i32 {
|
||||
v.clamp(ZOOM_FACTOR_MIN, ZOOM_FACTOR_MAX)
|
||||
}
|
||||
@@ -391,6 +396,8 @@ pub struct UserSettings {
|
||||
/// Scrolling pans and Ctrl+scroll (a touchpad pinch) zooms, for a
|
||||
/// touchpad that reports two-finger drags as wheel scrolls.
|
||||
pub touchpad_pan: bool,
|
||||
/// Interface scale in percent, on top of the display's own scale.
|
||||
pub ui_scale_percent: u16,
|
||||
pub zoom_factor: i32,
|
||||
/// CURSORSIZE: normalized crosshair reach; 5 retains the original 60 px arms.
|
||||
pub cursor_size: i32,
|
||||
@@ -811,6 +818,7 @@ impl Default for UserSettings {
|
||||
polar_increment_deg: 45.0,
|
||||
zoom_wheel_reversed: false,
|
||||
touchpad_pan: false,
|
||||
ui_scale_percent: 100,
|
||||
zoom_factor: 60,
|
||||
cursor_size: 5,
|
||||
pick_box: 3,
|
||||
|
||||
Reference in new issue
Block a user