simplified drawing background of asset delegate

This commit is contained in:
iLLiCiTiT 2021-11-18 12:17:57 +01:00
parent c89b57a14c
commit 721f8b75c1

View file

@ -179,16 +179,10 @@ class UnderlinesAssetDelegate(QtWidgets.QItemDelegate):
# When not needed to do a rounded corners (easier and without
# painter restore):
# painter.fillRect(
# item_rect,
# QtGui.QBrush(bg_color)
# )
pen = painter.pen()
pen.setStyle(QtCore.Qt.NoPen)
pen.setWidth(0)
painter.setPen(pen)
painter.setBrush(QtGui.QBrush(bg_color))
painter.drawRect(option.rect)
painter.fillRect(
option.rect,
QtGui.QBrush(bg_color)
)
if option.state & QtWidgets.QStyle.State_Selected:
for color, subset_rect in subset_rects:
@ -196,9 +190,6 @@ class UnderlinesAssetDelegate(QtWidgets.QItemDelegate):
continue
painter.fillRect(subset_rect, QtGui.QBrush(color))
painter.restore()
painter.save()
# Icon
icon_index = index.model().index(
index.row(), index.column(), index.parent()