Mercurial > hg > Feedworm
annotate FeedEntryItemDelegate.py @ 143:f0941f42314c
remove the normalize method, it was pulled up to the parent class
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 24 Aug 2011 11:04:09 +0200 |
parents | 0f9b3e57cff0 |
children | babe14449162 |
rev | line source |
---|---|
55
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 from PyQt4 import QtGui |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 from PyQt4.QtGui import QFont |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
4 |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
5 class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
6 def __init__(self): |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
7 QtGui.QStyledItemDelegate.__init__(self, None) |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
9 def paint(self, painter, style, index): |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
10 row = index.row() |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
11 entry = self.entries[row] |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 if entry.read: |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
13 style.font.setWeight(QFont.Normal) |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
14 else: |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
15 style.font.setWeight(QFont.Bold) |
0f9b3e57cff0
pull out FeedEntryItemDelegate into its own file
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
16 QtGui.QStyledItemDelegate.paint(self, painter, style, index) |