Add configurable image overlay settings

Introduce configurable image overlay options and persist them. Added new state fields (image_width, image_offset, image_enabled) with defaults and wired them into the image overlay: the image display now respects the enabled flag, uses image_width for scaling and image_offset for placement. Extended the Settings dialog (resized, API field sizing) with a new Image tab containing enable checkbox, width and offset spinboxes, and included these values when saving. Updated config read/write to include an Image section so settings persist across runs and extended save_settings to accept image_width and image_offset. Minor import/order cleanup in image dialog.
This commit is contained in:
Vxrtrauter
2026-04-04 02:06:06 +02:00
parent b59768bcff
commit cb7e74a224
5 changed files with 77 additions and 10 deletions
+12
View File
@@ -28,6 +28,12 @@ def create_config():
"image_path": f"{state.image_path}"
}
config["Image"] = {
"enable_image": f"{state.image_enabled}",
"image_width": f"{state.image_width}",
"image_offset": f"{state.image_offset}"
}
if platform.system() == "Windows":
config_dir = os.environ.get("APPDATA", os.path.expanduser("~\\AppData\\Roaming"))
else:
@@ -77,4 +83,10 @@ def read_config():
state.download_path = config.get("Paths", "download_path", fallback=state.download_path)
state.image_path = config.get("Paths", "image_path", fallback=state.image_path)
# Image
state.image_enabled = config.getboolean("Image", "enable_image", fallback=state.image_enabled)
state.image_width = config.getint("Image", "image_width", fallback=state.image_width)
state.image_offset = config.getint("Image", "image_offset", fallback=state.image_offset)
create_config()