diff options
author | jerous <jerous@gmail.com> | 2008-05-30 22:39:03 +0200 |
---|---|---|
committer | jerous <jerous@gmail.com> | 2008-05-30 22:40:48 +0200 |
commit | bc00da04b145b62d701cc2c5c44453a6b96984a3 (patch) | |
tree | dd5d405a23ae66d12ca7b487aba1ada4e7ec81e4 | |
parent | 17f83c115cb8d8979fbe0888d532ab4d10885e7d (diff) |
text of selected items is white
-rw-r--r-- | winMain.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -19,7 +19,7 @@ class SongList(QtGui.QWidget): minHeaderWidth=50 # alternating colors colors=[QtGui.QColor(255,255,255), QtGui.QColor(230,230,255)] - clrSel=QtGui.QColor(150,150,230) # color of selection + clrSel=QtGui.QColor(100,100,180) # color of selection clrBg=QtGui.QColor(200,200,230) # background color onDoubleClick=None @@ -334,15 +334,18 @@ class SongList(QtGui.QWidget): # determine color of row. Default is row-color, but can be overridden by # (in this order): hover, selection, special row color! clr=self.colors[row%2] + clrTxt=QtCore.Qt.black for range in self.selRows: if self.selMode==False and id>=range[0] and id<=range[1]: clr=self.clrSel + clrTxt=QtCore.Qt.white elif self.selMode and row>=min(range) and row<=max(range): clr=self.clrSel + clrTxt=QtCore.Qt.white if id==int(self.clrID[0]): + clrTxt=QtCore.Qt.white clr=self.clrID[1] - p.setPen(QtCore.Qt.black) p.fillRect(QtCore.QRect(2, y, width-3, lineHeight), QtGui.QBrush(clr)) p.setPen(QtGui.QColor(230,230,255)) p.drawRect(QtCore.QRect(2, y, width-3, lineHeight)) @@ -352,11 +355,13 @@ class SongList(QtGui.QWidget): if hdr[2]: rect=p.boundingRect(x, y, hdr[1]-margin, lineHeight, QtCore.Qt.AlignLeft, str(song.getTag(hdr[0]))) text=str(song.getTag(hdr[0])) + p.setPen(clrTxt) p.drawText(x, y+1, hdr[1]-margin, lineHeight, QtCore.Qt.AlignLeft, text) if rect.width()>hdr[1]-margin: p.fillRect(x+hdr[1]-15,y+1,15,lineHeight-1, QtGui.QBrush(clr)) p.drawText(x+hdr[1]-15,y+1,15,lineHeight-1, QtCore.Qt.AlignLeft, "...") x+=hdr[1] + p.setPen(QtCore.Qt.black) p.drawLine(QtCore.QPoint(x-margin,y), QtCore.QPoint(x-margin,y+lineHeight)) def paintEvent(self, event): |