[Xytovl] ability to configure font and colors of incoming / outgoing messages. Fixes #5311

This commit is contained in:
Yann Leboulanger 2009-10-13 13:42:44 +02:00
parent 997a8f8429
commit 2f1412050c
2 changed files with 36 additions and 3 deletions

View File

@ -90,11 +90,18 @@ class Config:
'mood_iconset': [ opt_str, DEFAULT_MOOD_ICONSET, '', True ],
'activity_iconset': [ opt_str, DEFAULT_ACTIVITY_ICONSET, '', True ],
'use_transports_iconsets': [ opt_bool, True, '', True ],
'inmsgcolor': [ opt_color, '#a40000', '', True ],
'outmsgcolor': [ opt_color, '#3465a4', '', True ],
'statusmsgcolor': [ opt_color, '#73d216', '', True ],
'inmsgcolor': [ opt_color, '#a40000', _('Incoming nickname color.'), True ],
'outmsgcolor': [ opt_color, '#3465a4', _('Outgoing nickname color.'), True ],
'inmsgtxtcolor': [ opt_color, '', _('Incoming text color.'), True ],
'outmsgtxtcolor': [ opt_color, '#a2a2a2', _('Outgoing text color.'), True ],
'statusmsgcolor': [ opt_color, '#73d216', _('Status message text color.'), True ],
'markedmsgcolor': [ opt_color, '#ff8080', '', True ],
'urlmsgcolor': [ opt_color, '#204a87', '', True ],
'inmsgfont': [ opt_str, '', _('Incoming nickname font.'), True ],
'outmsgfont': [ opt_str, '', _('Outgoing nickname font.'), True ],
'inmsgtxtfont': [ opt_str, '', _('Incoming text font.'), True ],
'outmsgtxtfont': [ opt_str, '', _('Outgoing text font.'), True ],
'statusmsgfont': [ opt_str, '', _('Status message text font.'), True ],
'collapsed_rows': [ opt_str, '', _('List (space separated) of rows (accounts and groups) that are collapsed.'), True ],
'roster_theme': [ opt_str, _('default'), '', True ],
'mergeaccounts': [ opt_bool, False, '', True ],

View File

@ -230,13 +230,35 @@ class ConversationTextview(gobject.GObject):
self.tagIn = buffer_.create_tag('incoming')
color = gajim.config.get('inmsgcolor')
font = pango.FontDescription(gajim.config.get('inmsgfont'))
self.tagIn.set_property('foreground', color)
self.tagIn.set_property('font-desc', font)
self.tagOut = buffer_.create_tag('outgoing')
color = gajim.config.get('outmsgcolor')
font = pango.FontDescription(gajim.config.get('outmsgfont'))
self.tagOut.set_property('foreground', color)
self.tagOut.set_property('font-desc', font)
self.tagStatus = buffer_.create_tag('status')
color = gajim.config.get('statusmsgcolor')
font = pango.FontDescription(gajim.config.get('satusmsgfont'))
self.tagStatus.set_property('foreground', color)
self.tagStatus.set_property('font-desc', font)
self.tagInText = buffer_.create_tag('incomingtxt')
color = gajim.config.get('inmsgtxtcolor')
font = pango.FontDescription(gajim.config.get('inmsgtxtfont'))
if color:
self.tagInText.set_property('foreground', color)
self.tagInText.set_property('font-desc', font)
self.tagOutText = buffer_.create_tag('outgoingtxt')
color = gajim.config.get('outmsgtxtcolor')
if color:
font = pango.FontDescription(gajim.config.get('outmsgtxtfont'))
self.tagOutText.set_property('foreground', color)
self.tagOutText.set_property('font-desc', font)
colors = gajim.config.get('gc_nicknames_colors')
colors = colors.split(':')
@ -1219,6 +1241,10 @@ class ConversationTextview(gobject.GObject):
'chat_merge_consecutive_nickname_indent'))
else:
self.print_name(name, kind, other_tags_for_name)
if kind == 'incoming':
text_tags.append('incomingtxt')
elif kind == 'outgoing':
text_tags.append('outgoingtxt')
self.print_subject(subject)
self.print_real_text(text, text_tags, name, xhtml, graphics=graphics)