mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix for flashing in the tag browser. See https://www.mobileread.com/forums/showthread.php?p=4341802#post4341802
This commit is contained in:
parent
285a538e37
commit
9362da31ff
@ -68,14 +68,14 @@ class TagDelegate(QStyledItemDelegate): # {{{
|
||||
icon.paint(painter, r, option.decorationAlignment, QIcon.Mode.Normal, QIcon.State.On)
|
||||
|
||||
def paint_text(self, painter, rect, flags, text, hover):
|
||||
set_color = hover and QApplication.instance().is_dark_theme
|
||||
if set_color:
|
||||
painter.save()
|
||||
pen = painter.pen()
|
||||
if hover and QApplication.instance().is_dark_theme:
|
||||
pen.setColor(QColor(Qt.GlobalColor.black))
|
||||
else:
|
||||
pen.setColor(QColor(Qt.GlobalColor.white))
|
||||
painter.setPen(pen)
|
||||
painter.drawText(rect, flags, text)
|
||||
if set_color:
|
||||
painter.restore()
|
||||
|
||||
def draw_text(self, style, painter, option, widget, index, item):
|
||||
|
Loading…
x
Reference in New Issue
Block a user