mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
feat: Add customizable accent color setting
Introduce an accent color preference across the app: add a settings UI input (with restart note), persist it to AppState and config (read/write), and accept it in save_settings. Integrate the value into theming: compute a semi-transparent selection color, apply it to table selection styles, and pass it to qdarktheme as the primary color (including when window transparency is enabled). Also apply the accent to the tracker combo selection styling as a UI polish.
This commit is contained in:
@@ -14,7 +14,8 @@ def create_config():
|
||||
"debug": str(state.debug),
|
||||
"ignore_updates": str(state.ignore_updates),
|
||||
"autoresume": str(state.autoresume),
|
||||
"window_transparency": str(state.window_transparency)
|
||||
"window_transparency": str(state.window_transparency),
|
||||
"accent_color": str(state.accent_color)
|
||||
}
|
||||
|
||||
config["Network"] = {
|
||||
@@ -84,6 +85,7 @@ def read_config():
|
||||
state.ignore_updates = config.getboolean("General", "ignore_updates", fallback=state.ignore_updates)
|
||||
state.autoresume = config.getboolean("General", "autoresume", fallback=state.autoresume)
|
||||
state.window_transparency = config.getboolean("General", "window_transparency", fallback=state.window_transparency)
|
||||
state.accent_color = config.get("General", "accent_color", fallback=state.accent_color)
|
||||
|
||||
# Network
|
||||
state.api_url = config.get("Network", "api_url", fallback=state.api_url)
|
||||
|
||||
@@ -5,7 +5,7 @@ from utils.data.state import state
|
||||
|
||||
|
||||
|
||||
def save_settings(close=lambda: None, apiurl=None, download_path=None, down_speed_limit=None, up_speed_limit=None, image_path=None, autoresume=None, max_connections=None, max_downloads=None, bound_interface=None, image_width=None, image_offset=None, image_opacity=None, image_as_wallpaper=None, image_position=None):
|
||||
def save_settings(close=lambda: None, apiurl=None, download_path=None, down_speed_limit=None, up_speed_limit=None, image_path=None, autoresume=None, max_connections=None, max_downloads=None, bound_interface=None, image_width=None, image_offset=None, image_opacity=None, image_as_wallpaper=None, image_position=None, accent_color=None):
|
||||
if apiurl is not None:
|
||||
state.api_url = apiurl
|
||||
if download_path is not None:
|
||||
@@ -34,6 +34,8 @@ def save_settings(close=lambda: None, apiurl=None, download_path=None, down_spee
|
||||
state.image_as_wallpaper = image_as_wallpaper
|
||||
if image_position is not None:
|
||||
state.image_position = image_position
|
||||
if accent_color is not None:
|
||||
state.accent_color = accent_color
|
||||
|
||||
update_settings() # Update LibTorrent Session Settings
|
||||
consoleLog("Saved Settings")
|
||||
|
||||
@@ -25,6 +25,7 @@ class AppState(QObject):
|
||||
|
||||
# GUI
|
||||
self.window_transparency: bool = False
|
||||
self.accent_color: str = ""
|
||||
self.trackertable: QTableWidget
|
||||
self.interfaces: List = []
|
||||
self.active_interfaces: List = []
|
||||
|
||||
Reference in New Issue
Block a user