diff --git a/TODO.md b/TODO.md index 37804d18..93d73c7c 100644 --- a/TODO.md +++ b/TODO.md @@ -69,7 +69,6 @@ - Spinner when loading past room events, images or clicking buttons - Theming - Thin white icons - - Copy the default theme to user data dir - Distribute fonts - preferredIconPack: accept multiple values - Find icon packs in user data dir diff --git a/src/python/config_files.py b/src/python/config_files.py index ae95b70d..96f0c0af 100644 --- a/src/python/config_files.py +++ b/src/python/config_files.py @@ -142,22 +142,16 @@ class Theme(ConfigFile): def path(self) -> Path: # pylint: disable=no-member data_dir = Path(self.backend.app.appdirs.user_data_dir) - user_file = data_dir / "themes" / self.filename - - if user_file.exists(): - return user_file - - return Path("src") / "themes" / self.filename + return data_dir / "themes" / self.filename async def default_data(self) -> str: async with aiofiles.open("src/themes/Default.qpl", "r") as file: - return file.read() + return await file.read() async def read(self) -> str: + if not self.path.exists(): + await self.write(await self.default_data()) + return convert_to_qml(await super().read()) - - - async def write(self, data: str) -> None: - raise NotImplementedError() diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index 1c79a975..9e41bfb9 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -58,11 +58,12 @@ colors: color link: accentText color code: hsluv(hue + 5, saturation * 1.5, intensity * 60) - NumberAnimation on intensity // For testing + // Example of an animation, set running: true to enable + NumberAnimation on hue running: false from: 0 - to: 10 - duration: 20000 + to: 360 + duration: 10000 loops: Animation.Infinite