summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-07 01:25:30 +0200
committermathieui <mathieui@mathieui.net>2014-04-07 01:25:30 +0200
commit1ce485c6faa15f624dcc79b3260bf3a9899b5cee (patch)
tree2e2da40dab7babf528853b3d0fd92ef4485abb8c /src/windows.py
parent53040305ce97bd532bd27cf0c2f626136f34a572 (diff)
downloadpoezio-1ce485c6faa15f624dcc79b3260bf3a9899b5cee.tar.gz
poezio-1ce485c6faa15f624dcc79b3260bf3a9899b5cee.tar.bz2
poezio-1ce485c6faa15f624dcc79b3260bf3a9899b5cee.tar.xz
poezio-1ce485c6faa15f624dcc79b3260bf3a9899b5cee.zip
Fix #2354 (logs are badly colored with xhtml history)
- now it should work properly - add a COLOR_LOG_MSG theming option, used both for local and remote history
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/windows.py b/src/windows.py
index cbd661ec..997fb72b 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -35,7 +35,7 @@ import core
import singleton
import collections
-from theming import get_theme, to_curses_attr, read_tuple
+from theming import get_theme, to_curses_attr, read_tuple, dump_tuple
FORMAT_CHAR = '\x19'
# These are non-printable chars, so they should never appear in the input,
@@ -908,6 +908,11 @@ class TextWin(Win):
txt = message.txt
if not txt:
return []
+ if len(message.str_time) > 8:
+ default_color = (FORMAT_CHAR + dump_tuple(get_theme().COLOR_LOG_MSG)
+ + '}')
+ else:
+ default_color = None
ret = []
nick = truncate_nick(message.nickname)
offset = 0
@@ -933,7 +938,10 @@ class TextWin(Win):
if attrs:
prepend = FORMAT_CHAR + FORMAT_CHAR.join(attrs)
else:
- prepend = ''
+ if default_color:
+ prepend = default_color
+ else:
+ prepend = ''
ret.append(saved)
return ret