HistoryManager: Convert RGB to hex
This commit is contained in:
parent
5d853e902a
commit
2a4e59654f
|
@ -89,6 +89,7 @@ from gajim.gtk import YesNoDialog
|
||||||
from gajim.gtk import ErrorDialog
|
from gajim.gtk import ErrorDialog
|
||||||
from gajim.gtk import ConfirmationDialog
|
from gajim.gtk import ConfirmationDialog
|
||||||
from gajim.gtk.filechoosers import FileSaveDialog
|
from gajim.gtk.filechoosers import FileSaveDialog
|
||||||
|
from gajim.gtk.util import convert_rgb_to_hex
|
||||||
from gajim import gtkgui_helpers
|
from gajim import gtkgui_helpers
|
||||||
|
|
||||||
|
|
||||||
|
@ -393,16 +394,18 @@ class HistoryManager:
|
||||||
else:
|
else:
|
||||||
color = None
|
color = None
|
||||||
if kind in (KindConstant.SINGLE_MSG_RECV,
|
if kind in (KindConstant.SINGLE_MSG_RECV,
|
||||||
KindConstant.CHAT_MSG_RECV, KindConstant.GC_MSG):
|
KindConstant.CHAT_MSG_RECV,
|
||||||
# it is the other side
|
KindConstant.GC_MSG):
|
||||||
color = app.css_config.get_value('.gajim-incoming-nickname', StyleAttr.COLOR) # so incoming color
|
color = app.css_config.get_value(
|
||||||
|
'.gajim-incoming-nickname', StyleAttr.COLOR)
|
||||||
elif kind in (KindConstant.SINGLE_MSG_SENT,
|
elif kind in (KindConstant.SINGLE_MSG_SENT,
|
||||||
KindConstant.CHAT_MSG_SENT): # it is us
|
KindConstant.CHAT_MSG_SENT):
|
||||||
color = app.css_config.get_value('.gajim-outgoing-nickname', StyleAttr.COLOR) # so outgoing color
|
color = app.css_config.get_value(
|
||||||
|
'.gajim-outgoing-nickname', StyleAttr.COLOR)
|
||||||
elif kind in (KindConstant.STATUS,
|
elif kind in (KindConstant.STATUS,
|
||||||
KindConstant.GCSTATUS): # is is statuses
|
KindConstant.GCSTATUS):
|
||||||
# so status color
|
color = app.css_config.get_value(
|
||||||
color = app.css_config.get_value('.gajim-status-message', StyleAttr.COLOR)
|
'.gajim-status-message', StyleAttr.COLOR)
|
||||||
# include status into (status) message
|
# include status into (status) message
|
||||||
if message is None:
|
if message is None:
|
||||||
message = ''
|
message = ''
|
||||||
|
@ -413,10 +416,11 @@ class HistoryManager:
|
||||||
|
|
||||||
message_ = '<span'
|
message_ = '<span'
|
||||||
if color:
|
if color:
|
||||||
message_ += ' foreground="%s"' % color
|
message_ += ' foreground="%s"' % convert_rgb_to_hex(color)
|
||||||
message_ += '>%s</span>' % GLib.markup_escape_text(message)
|
message_ += '>%s</span>' % GLib.markup_escape_text(message)
|
||||||
self.logs_liststore.append((str(log_line_id), str(jid_id),
|
self.logs_liststore.append(
|
||||||
time_, message_, subject, nickname))
|
(str(log_line_id), str(jid_id),
|
||||||
|
time_, message_, subject, nickname))
|
||||||
|
|
||||||
def _fill_search_results_listview(self, text):
|
def _fill_search_results_listview(self, text):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue