feat(desktop): add auto-zoom scaling for high-DPI displays#406
feat(desktop): add auto-zoom scaling for high-DPI displays#406SuperComboGamer wants to merge 6 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present. |
Auto-detect display resolution and scale the UI proportionally so the app is usable on 4K/1440p monitors without affecting 1080p users. - Compute zoom factor from the display's DIP short edge relative to 1080p, snapped to 0.25 increments (max 3.0x) - Apply zoom on window creation, display change, move/resize across monitors, unmaximize, and leave-fullscreen - Clamp window bounds to the display work area after zoom changes - Scale minimum window size with zoom, capped to the work area - Replace built-in viewMenu with custom View menu supporting Ctrl+=/Ctrl+Plus (zoom in), Ctrl+- (zoom out), Ctrl+0 (reset) - Guard against re-entrant setBounds->move loops and skip zoom adjustments while fullscreen or maximized
124eaa5 to
04d00ce
Compare
|
Couple Qs:
|
… zoom logic - Store user zoom preference as a delta from auto-computed zoom so it transfers correctly across monitors with different DPIs - Skip auto-zoom on macOS (Retina handles DPI natively) - Clamp delta in adjustZoom to prevent unbounded accumulation - Add NaN guard on zoom delta read/write - Debounce display-metrics-changed handler - Move reentrancy guard into applyAutoZoom (global Set, protects all call sites) - Reset Zoom now applies to all windows - Set zoom factor even when maximized/fullscreen - Extract computeEffectiveZoom helper
|
If I set a zoom myself, will this override it? Is this windows-only? Can it be? How does it handle multiple monitors? Note: I don't have a Mac or Linux machine so I couldn't test on those platforms, but it should work, macOS just skips auto-zoom entirely and the zoom persistence uses standard Electron/Node APIs. |
|
Closes #861 |
Windows does not automatically scale Electron app content for high-DPI displays the way macOS does, causing the app to
appear tiny on 4K/1440p monitors. This adds automatic zoom scaling to fix that.
auto-zoom baseline
Note
Add auto-zoom scaling for high-DPI displays in the desktop app
Macroscope summarized 27ca07a.