From 1ce485c6faa15f624dcc79b3260bf3a9899b5cee Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 7 Apr 2014 01:25:30 +0200 Subject: 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 --- src/windows.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/windows.py') 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 -- cgit v1.2.3