mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Highlight currently selected view
This commit is contained in:
parent
9f30d9d090
commit
2d9a852453
@ -7,7 +7,7 @@ import re, os, traceback
|
|||||||
from PyQt4.QtGui import QListView, QIcon, QFont, QLabel, QListWidget, \
|
from PyQt4.QtGui import QListView, QIcon, QFont, QLabel, QListWidget, \
|
||||||
QListWidgetItem, QTextCharFormat, QApplication, \
|
QListWidgetItem, QTextCharFormat, QApplication, \
|
||||||
QSyntaxHighlighter, QCursor, QColor, QWidget, QDialog, \
|
QSyntaxHighlighter, QCursor, QColor, QWidget, QDialog, \
|
||||||
QPixmap, QMovie
|
QPixmap, QMovie, QPalette
|
||||||
from PyQt4.QtCore import QAbstractListModel, QVariant, Qt, SIGNAL, \
|
from PyQt4.QtCore import QAbstractListModel, QVariant, Qt, SIGNAL, \
|
||||||
QRegExp, QSettings, QSize, QModelIndex
|
QRegExp, QSettings, QSize, QModelIndex
|
||||||
|
|
||||||
@ -204,6 +204,13 @@ class LocationModel(QAbstractListModel):
|
|||||||
font = QFont('monospace')
|
font = QFont('monospace')
|
||||||
font.setBold(row == self.highlight_row)
|
font.setBold(row == self.highlight_row)
|
||||||
data = QVariant(font)
|
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
|
return data
|
||||||
|
|
||||||
def headerData(self, section, orientation, role):
|
def headerData(self, section, orientation, role):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user