Read TUI palette overrides from settings
This commit is contained in:
parent
94b4b35197
commit
740f7fafd4
1 changed files with 7 additions and 2 deletions
|
@ -3,7 +3,7 @@ import urwid
|
||||||
|
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
|
|
||||||
from toot import api, config, __version__
|
from toot import api, config, __version__, settings
|
||||||
from toot.console import get_default_visibility
|
from toot.console import get_default_visibility
|
||||||
from toot.exceptions import ApiError
|
from toot.exceptions import ApiError
|
||||||
|
|
||||||
|
@ -88,9 +88,14 @@ class TUI(urwid.Frame):
|
||||||
screen.set_terminal_properties(1)
|
screen.set_terminal_properties(1)
|
||||||
screen.reset_default_terminal_palette()
|
screen.reset_default_terminal_palette()
|
||||||
|
|
||||||
|
palette = MONO_PALETTE if args.no_color else PALETTE
|
||||||
|
overrides = settings.get_setting("tui.palette", dict, {})
|
||||||
|
for name, styles in overrides.items():
|
||||||
|
palette.append(tuple([name] + styles))
|
||||||
|
|
||||||
loop = urwid.MainLoop(
|
loop = urwid.MainLoop(
|
||||||
tui,
|
tui,
|
||||||
palette=MONO_PALETTE if args.no_color else PALETTE,
|
palette=palette,
|
||||||
event_loop=urwid.AsyncioEventLoop(),
|
event_loop=urwid.AsyncioEventLoop(),
|
||||||
unhandled_input=tui.unhandled_input,
|
unhandled_input=tui.unhandled_input,
|
||||||
screen=screen,
|
screen=screen,
|
||||||
|
|
Loading…
Reference in a new issue