Don't use user theme in debug mode
This commit is contained in:
parent
b6290ad3c9
commit
a2469bd994
1
TODO.md
1
TODO.md
|
@ -68,7 +68,6 @@
|
|||
- Prevent using the SendBox if no permission (power levels)
|
||||
- Spinner when loading past room events, images or clicking buttons
|
||||
- Theming
|
||||
- Don't use user theme in debug mode
|
||||
- Don't create additional lines in theme conversion (braces)
|
||||
- Recursively merge default and user theme
|
||||
- Distribute fonts
|
||||
|
|
|
@ -24,6 +24,7 @@ class App:
|
|||
|
||||
from .backend import Backend
|
||||
self.backend = Backend(app=self)
|
||||
self.debug = False
|
||||
|
||||
from .image_provider import ImageProvider
|
||||
self.image_provider = ImageProvider(self)
|
||||
|
@ -35,7 +36,9 @@ class App:
|
|||
|
||||
|
||||
def is_debug_on(self, cli_flags: Sequence[str] = ()) -> bool:
|
||||
return "-d" in cli_flags or "--debug" in cli_flags
|
||||
debug = "-d" in cli_flags or "--debug" in cli_flags
|
||||
self.debug = debug
|
||||
return debug
|
||||
|
||||
|
||||
def _loop_starter(self) -> None:
|
||||
|
|
|
@ -151,6 +151,10 @@ class Theme(ConfigFile):
|
|||
|
||||
|
||||
async def read(self) -> str:
|
||||
# pylint: disable=no-member
|
||||
if self.backend.app.debug:
|
||||
return convert_to_qml(await self.default_data())
|
||||
|
||||
if not self.path.exists():
|
||||
await self.write(await self.default_data())
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user