Color fixes in messagelists

Fixes #87
This commit is contained in:
mailchuck 2015-11-01 08:30:06 +01:00
parent a4c4b44afa
commit eb6567c0d7
No known key found for this signature in database
GPG Key ID: B6311FA753FBF089

View File

@ -2391,10 +2391,7 @@ class MyForm(QtGui.QMainWindow):
newItem.setToolTip(unicode(acct.toLabel, 'utf-8'))
newItem.setFont(font)
newItem.setData(Qt.UserRole, str(toAddress))
if acct.type == 'mailinglist':
newItem.setTextColor(QtGui.QColor(137, 04, 177)) # magenta
if acct.type == 'chan':
newItem.setTextColor(QtGui.QColor(216, 119, 0)) # orange
newItem.setTextColor(AccountColor(toAddress).accountColor())
inbox.insertRow(0)
newItem.setIcon(avatarize(toAddress))
inbox.setItem(0, 0, newItem)
@ -2405,6 +2402,7 @@ class MyForm(QtGui.QMainWindow):
self.notifierShow(unicode(_translate("MainWindow",'New Message').toUtf8(),'utf-8'), unicode(_translate("MainWindow",'From ').toUtf8(),'utf-8') + unicode(acct.fromLabel, 'utf-8'), self.SOUND_UNKNOWN, None)
newItem.setData(Qt.UserRole, str(fromAddress))
newItem.setFont(font)
newItem.setTextColor(AccountColor(fromAddress).accountColor())
newItem.setIcon(avatarize(fromAddress))
inbox.setItem(0, 1, newItem)
newItem = QtGui.QTableWidgetItem(unicode(acct.subject, 'utf-8)'))
@ -3791,12 +3789,14 @@ class MyForm(QtGui.QMainWindow):
font = QFont()
font.setBold(False)
# inventoryHashesToMarkRead = []
currentRow = self.getCurrentMessagelist().currentRow()
currentRow = tableWidget.currentRow()
# inventoryHashToMarkRead = str(tableWidget.item(
# currentRow, 3).data(Qt.UserRole).toPyObject())
# inventoryHashesToMarkRead.append(inventoryHashToMarkRead)
tableWidget.item(currentRow, 0).setFont(font)
tableWidget.item(currentRow, 0).setTextColor(AccountColor(str(tableWidget.item(currentRow, 0).data(Qt.UserRole).toPyObject())).accountColor())
tableWidget.item(currentRow, 1).setFont(font)
tableWidget.item(currentRow, 1).setTextColor(AccountColor(str(tableWidget.item(currentRow, 1).data(Qt.UserRole).toPyObject())).accountColor())
tableWidget.item(currentRow, 2).setFont(font)
tableWidget.item(currentRow, 3).setFont(font)
self.propagateUnreadCount(self.getCurrentAccount(), folder, self.getCurrentTreeWidget(), -1)