Mercurial > hg > Feedworm
diff FeedEntryItemDelegate.py @ 55:0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 18 May 2010 03:17:06 +0200 |
parents | |
children | babe14449162 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FeedEntryItemDelegate.py Tue May 18 03:17:06 2010 +0200 @@ -0,0 +1,16 @@ + +from PyQt4 import QtGui +from PyQt4.QtGui import QFont + +class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): + def __init__(self): + QtGui.QStyledItemDelegate.__init__(self, None) + + def paint(self, painter, style, index): + row = index.row() + entry = self.entries[row] + if entry.read: + style.font.setWeight(QFont.Normal) + else: + style.font.setWeight(QFont.Bold) + QtGui.QStyledItemDelegate.paint(self, painter, style, index)