mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
411136c614
@ -68,15 +68,16 @@ class TagDelegate(QStyledItemDelegate): # {{{
|
|||||||
icon.paint(painter, r, option.decorationAlignment, QIcon.Mode.Normal, QIcon.State.On)
|
icon.paint(painter, r, option.decorationAlignment, QIcon.Mode.Normal, QIcon.State.On)
|
||||||
|
|
||||||
def paint_text(self, painter, rect, flags, text, hover):
|
def paint_text(self, painter, rect, flags, text, hover):
|
||||||
set_color = hover and QApplication.instance().is_dark_theme
|
painter.save()
|
||||||
if set_color:
|
pen = painter.pen()
|
||||||
painter.save()
|
if QApplication.instance().is_dark_theme:
|
||||||
pen = painter.pen()
|
if hover:
|
||||||
pen.setColor(QColor(Qt.GlobalColor.black))
|
pen.setColor(QColor(Qt.GlobalColor.black))
|
||||||
painter.setPen(pen)
|
else:
|
||||||
|
pen.setColor(QColor(Qt.GlobalColor.white))
|
||||||
|
painter.setPen(pen)
|
||||||
painter.drawText(rect, flags, text)
|
painter.drawText(rect, flags, text)
|
||||||
if set_color:
|
painter.restore()
|
||||||
painter.restore()
|
|
||||||
|
|
||||||
def draw_text(self, style, painter, option, widget, index, item):
|
def draw_text(self, style, painter, option, widget, index, item):
|
||||||
tr = style.subElementRect(QStyle.SubElement.SE_ItemViewItemText, option, widget)
|
tr = style.subElementRect(QStyle.SubElement.SE_ItemViewItemText, option, widget)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user