From 2a145abf9b3ec78c3d526a75f08cd6fe4908d077 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 20 Dec 2012 19:19:55 +0100 Subject: Allow theming of the info buffer messages (only the left part) --- src/core.py | 4 +++- src/theming.py | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.py b/src/core.py index 93a52758..0b684c48 100644 --- a/src/core.py +++ b/src/core.py @@ -1062,7 +1062,9 @@ class Core(object): if words and words in msg: log.debug('Did not show the message:\n\t%s> %s', typ, msg) return False - nb_lines = self.information_buffer.add_message(msg, nickname=typ) + colors = get_theme().INFO_COLORS + color = colors.get(typ, colors.get('default', None)) + nb_lines = self.information_buffer.add_message(msg, nickname=typ, nick_color=color) if isinstance(self.current_tab(), tabs.RosterInfoTab): self.refresh_window() elif typ != '' and typ.lower() in config.get('information_buffer_popup_on', diff --git a/src/theming.py b/src/theming.py index 910e62d9..aba42a1c 100644 --- a/src/theming.py +++ b/src/theming.py @@ -194,6 +194,14 @@ class Theme(object): # Vertical tab list color COLOR_VERTICAL_TAB_NUMBER = (34, -1) + # Info messages color (the part before the ">") + INFO_COLORS = { + 'Info': (5, -1), + 'Error': (16, 1), + 'Roster': (2, 16), + 'default': (0, -1), + } + # This is the default theme object, used if no theme is defined in the conf theme = Theme() -- cgit v1.2.3