From 2d9a85245374fe1f615386f3a5c687bed3c21f9c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 28 Mar 2009 02:55:27 -0700 Subject: [PATCH] IGN:Highlight currently selected view --- src/calibre/gui2/widgets.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index 4795341511..535ec4251f 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -7,7 +7,7 @@ import re, os, traceback from PyQt4.QtGui import QListView, QIcon, QFont, QLabel, QListWidget, \ QListWidgetItem, QTextCharFormat, QApplication, \ QSyntaxHighlighter, QCursor, QColor, QWidget, QDialog, \ - QPixmap, QMovie + QPixmap, QMovie, QPalette from PyQt4.QtCore import QAbstractListModel, QVariant, Qt, SIGNAL, \ QRegExp, QSettings, QSize, QModelIndex @@ -204,6 +204,13 @@ class LocationModel(QAbstractListModel): font = QFont('monospace') font.setBold(row == self.highlight_row) data = QVariant(font) + elif role == Qt.ForegroundRole and row == self.highlight_row: + return QVariant(QApplication.palette().brush( + QPalette.HighlightedText)) + elif role == Qt.BackgroundRole and row == self.highlight_row: + return QVariant(QApplication.palette().brush( + QPalette.Highlight)) + return data def headerData(self, section, orientation, role):