Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ __pycache__/
.tox/
.venv*/
.vscode/
.zed/
*.blend1
*.code-workspace
/.coverage*
Expand All @@ -23,4 +24,4 @@ cacert.pem
htmlcov
main.py
MANIFEST.in
VERSION
VERSION
14 changes: 13 additions & 1 deletion DisplayCAL/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,8 @@ def getcfg(
if value is None:
if has_default and fallback:
value = defval
debug_print(name, "- falling back to", value)
if defval is not None:
debug_print(name, "- falling back to", value)
elif DEBUG and not has_default:
print("Warning - unknown option:", name)
if raw:
Expand Down Expand Up @@ -2647,9 +2648,19 @@ def initcfg(
if isinstance(val, list):
cfg.set(section, name, "\n".join(val))
finally:
if not module and getcfg("lang", fallback=False) is None:
setcfg("lang", DEFAULTS["lang"], cfg=cfg)
if not module and getcfg("calibration.ambient_viewcond_adjust", fallback=False) is None:
setcfg(
"calibration.ambient_viewcond_adjust",
DEFAULTS["calibration.ambient_viewcond_adjust"],
cfg=cfg,
)
if not module and not getcfg("calibration.ambient_viewcond_adjust"):
# Reset to default
setcfg("calibration.ambient_viewcond_adjust.lux", None, cfg=cfg)
if not module and getcfg("profile.save_path", fallback=False) is None:
setcfg("profile.save_path", STORAGE, cfg=cfg)


def fetch_config_files(
Expand Down Expand Up @@ -2890,6 +2901,7 @@ def set_default_app_dpi() -> None:
if txt_scale:
dpi = round(dpi * txt_scale)
DEFAULTS["app.dpi"] = dpi
setcfg("app.dpi", dpi)
DPISET = True


Expand Down
Loading