summaryrefslogtreecommitdiff
path: root/poezio/ui/render.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2021-11-15 19:44:16 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2021-11-15 19:44:16 +0100
commitf6a53e66c73e69bff27ce6abdbb4ca01cf5e2516 (patch)
tree9ba44637dd5eee3c5424c139425447e32cde9d43 /poezio/ui/render.py
parent69f28e97f3276c2c817287d97168dcca8ab7e4c0 (diff)
downloadpoezio-f6a53e66c73e69bff27ce6abdbb4ca01cf5e2516.tar.gz
poezio-f6a53e66c73e69bff27ce6abdbb4ca01cf5e2516.tar.bz2
poezio-f6a53e66c73e69bff27ce6abdbb4ca01cf5e2516.tar.xz
poezio-f6a53e66c73e69bff27ce6abdbb4ca01cf5e2516.zip
Make message format more configurable around nicks
Normal messages were previously hardcoded to 'nick> ', and /me messages to '* nick ', this commit adds three new theme variables to make these configurable.
Diffstat (limited to 'poezio/ui/render.py')
-rw-r--r--poezio/ui/render.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/poezio/ui/render.py b/poezio/ui/render.py
index 0d1e8d2b..2256dc14 100644
--- a/poezio/ui/render.py
+++ b/poezio/ui/render.py
@@ -178,18 +178,19 @@ def write_pre_message(msg: Message, win: Win, with_timestamps: bool, nick_size:
offset += PreMessageHelpers.write_ack(win)
else:
offset += PreMessageHelpers.write_nack(win)
+ theme = get_theme()
if msg.me:
- with win.colored_text(color=get_theme().COLOR_ME_MESSAGE):
- win.addstr('* ')
+ with win.colored_text(color=theme.COLOR_ME_MESSAGE):
+ win.addstr(theme.CHAR_BEFORE_NICK_ME)
PreMessageHelpers.write_nickname(win, nick, color, msg.highlight)
offset += PreMessageHelpers.write_revisions(win, msg)
- win.addstr(' ')
- offset += 3
+ win.addstr(theme.CHAR_AFTER_NICK_ME)
+ offset += len(theme.CHAR_BEFORE_NICK_ME) + len(theme.CHAR_AFTER_NICK_ME)
else:
PreMessageHelpers.write_nickname(win, nick, color, msg.highlight)
offset += PreMessageHelpers.write_revisions(win, msg)
- win.addstr('> ')
- offset += 2
+ win.addstr(theme.CHAR_AFTER_NICK)
+ offset += len(theme.CHAR_AFTER_NICK)
return offset