Commit 7ea66ee2 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Don't show colors in column UI when the user disabled it

parent 224e414a
...@@ -163,6 +163,10 @@ class UIApplication(CLIApplicationBase): ...@@ -163,6 +163,10 @@ class UIApplication(CLIApplicationBase):
self._set_alarm_for_next_midnight_update() self._set_alarm_for_next_midnight_update()
def _create_color_palette(self): def _create_color_palette(self):
if not config().colors():
# return an empty palette:
return []
project_color = to_urwid_color(config().project_color()) project_color = to_urwid_color(config().project_color())
context_color = to_urwid_color(config().context_color()) context_color = to_urwid_color(config().context_color())
metadata_color = to_urwid_color(config().metadata_color()) metadata_color = to_urwid_color(config().metadata_color())
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
import re import re
import urwid import urwid
from topydo.lib.Config import config
from topydo.lib.ListFormat import ListFormatParser from topydo.lib.ListFormat import ListFormatParser
from topydo.lib.ProgressColor import progress_color from topydo.lib.ProgressColor import progress_color
from topydo.ui.Utils import PaletteItem, to_urwid_color from topydo.ui.Utils import PaletteItem, to_urwid_color
...@@ -86,7 +87,7 @@ class TodoWidget(urwid.WidgetWrap): ...@@ -86,7 +87,7 @@ class TodoWidget(urwid.WidgetWrap):
priority_widget = urwid.Text(priority_text) priority_widget = urwid.Text(priority_text)
self.text_widget = urwid.Text(txt_markup) self.text_widget = urwid.Text(txt_markup)
progress = to_urwid_color(progress_color(p_todo)) progress = to_urwid_color(progress_color(p_todo)) if config().colors() else PaletteItem.DEFAULT
progress_bar = urwid.AttrMap( progress_bar = urwid.AttrMap(
urwid.SolidFill(' '), urwid.SolidFill(' '),
urwid.AttrSpec(PaletteItem.DEFAULT, progress, 256), urwid.AttrSpec(PaletteItem.DEFAULT, progress, 256),
...@@ -106,8 +107,8 @@ class TodoWidget(urwid.WidgetWrap): ...@@ -106,8 +107,8 @@ class TodoWidget(urwid.WidgetWrap):
self.widget = urwid.AttrMap( self.widget = urwid.AttrMap(
self.columns, self.columns,
_markup(p_todo, False), # no focus _markup(p_todo, p_focus=False),
_markup(p_todo, True) # focus _markup(p_todo, p_focus=True)
) )
super().__init__(self.widget) super().__init__(self.widget)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment