diff options
author | Florent Le Coz <louiz@louiz.org> | 2012-12-15 02:35:52 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-12-15 02:42:30 +0100 |
commit | 786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a (patch) | |
tree | e3374c15f93c8e71b11f7bf486e8687898532883 /src/windows.py | |
parent | fb8295c05f5ff154a1826a7056f65a526d7d4dd2 (diff) | |
download | poezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.tar.gz poezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.tar.bz2 poezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.tar.xz poezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.zip |
Introduce a special "reverse" value for the COLOR_HIGHLIGHT_NICK theme option.
If COLOR_HIGHLIGHT_NICK = "reverse", the highlight nick will be in reverse
mode.
fix #2165
Diffstat (limited to 'src/windows.py')
-rw-r--r-- | src/windows.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/windows.py b/src/windows.py index e139e87d..9b12bbb6 100644 --- a/src/windows.py +++ b/src/windows.py @@ -831,7 +831,18 @@ class TextWin(Win): color = None if with_timestamps: self.write_time(msg.str_time) - self.write_nickname(msg.nickname, color) + if msg.highlight: + hl_color = get_theme().COLOR_HIGHLIGHT_NICK + if hl_color == "reverse": + self._win.attron(curses.A_REVERSE) + else: + color = hl_color + self.write_nickname(msg.nickname, color) + if hl_color == "reverse": + self._win.attroff(curses.A_REVERSE) + else: + self.write_nickname(msg.nickname, color) + self.addstr("> ") if y != self.height-1: self.addstr('\n') self._win.attrset(0) @@ -871,7 +882,6 @@ class TextWin(Win): self.addstr(truncate_nick(nickname)) if color: self._win.attroff(to_curses_attr(color)) - self.addstr("> ") def write_time(self, time): """ |