window: max_zoom derivat del display via Screen::detectMaxZoom()

This commit is contained in:
2026-05-17 17:46:49 +02:00
parent 7006207b7e
commit 659e37e5a1
4 changed files with 49 additions and 6 deletions
+6 -3
View File
@@ -69,7 +69,9 @@ namespace Options {
if (!yaml.contains("window")) { return; }
const auto &win = yaml["window"];
parseIntField(win, "zoom", window.zoom);
if (window.zoom < 1 || window.zoom > window.max_zoom) {
// El bound superior s'aplica més tard a `Screen::detectMaxZoom()`
// un cop sabem la resolució real del display.
if (window.zoom < 1) {
window.zoom = Defaults::Window::ZOOM;
}
}
@@ -270,10 +272,11 @@ namespace Options {
file << "config_version: " << settings.config_version << "\n\n";
// WINDOW
// `max_zoom` no es guarda — es deriva del display a cada arranc via
// `Screen::detectMaxZoom()`.
file << "# WINDOW\n";
file << "window:\n";
file << " zoom: " << window.zoom << "\n";
file << " max_zoom: " << window.max_zoom << "\n\n";
file << " zoom: " << window.zoom << "\n\n";
// VIDEO
file << "# VIDEO\n";