GlyphDBEdit: display glyph texts in proper color.
This commit is contained in:
parent
458ef0e6f4
commit
54830ce2a3
2 changed files with 7 additions and 0 deletions
|
|
@ -43,6 +43,11 @@ class GlyphData(object):
|
|||
def color(self):
|
||||
return self.image.color
|
||||
|
||||
@property
|
||||
def qcolor(self):
|
||||
from PyQt4.QtGui import QColor
|
||||
return QColor(*self.color)
|
||||
|
||||
@property
|
||||
def style(self):
|
||||
return Style(self.color, self.bold, self.italic)
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ class TextColumn(Column):
|
|||
if config.glyph_font_size:
|
||||
font.setPixelSize(config.glyph_font_size)
|
||||
return font
|
||||
elif role == Qt.ForegroundRole:
|
||||
return glyph_data.qcolor
|
||||
else:
|
||||
return super().data(glyph_data, role)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue