From ad63e956cfbba58719dad03b0be37c54c8b0a866 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sun, 1 Nov 2015 08:29:13 +0100 Subject: [PATCH] accountBrush improvements Moved code into the method --- src/bitmessageqt/foldertree.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/bitmessageqt/foldertree.py b/src/bitmessageqt/foldertree.py index 30fdf82a..6f5ad40c 100644 --- a/src/bitmessageqt/foldertree.py +++ b/src/bitmessageqt/foldertree.py @@ -15,7 +15,9 @@ class AccountMixin (object): return QtGui.QApplication.palette().text().color() def accountBrush(self): - return QtGui.QBrush(self.accountColor()) + brush = QtGui.QBrush(self.accountColor()) + brush.setStyle(QtCore.Qt.NoBrush) + return brush def setAddress(self, address): self.address = str(address) @@ -129,9 +131,7 @@ class Ui_AddressWidget(QtGui.QTreeWidgetItem, AccountMixin): self.setFont(0, font) #set text color - brush = self.accountBrush() - brush.setStyle(QtCore.Qt.NoBrush) - self.setForeground(0, brush) + self.setForeground(0, self.accountBrush()) self.setIcon(0, avatarize(self.address)) self.setText(0, text) @@ -212,9 +212,7 @@ class Ui_SubscriptionWidget(Ui_AddressWidget, AccountMixin): self.setFont(0, font) #set text color - brush = self.accountBrush() - brush.setStyle(QtCore.Qt.NoBrush) - self.setForeground(0, brush) + self.setForeground(0, self.accountBrush()) self.setIcon(0, avatarize(self.address)) self.setText(0, text) @@ -254,9 +252,7 @@ class Ui_AddressBookWidgetItem(QtGui.QTableWidgetItem, AccountMixin): except: self.type = 0 self.setEnabled(True) - brush = self.accountBrush() - brush.setStyle(QtCore.Qt.NoBrush) - self.setForeground(brush) + self.setForeground(self.accountBrush()) def __lt__ (self, other): if (isinstance(other, Ui_AddressBookWidgetItem)):