mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
simplified drawing background of asset delegate
This commit is contained in:
parent
c89b57a14c
commit
721f8b75c1
1 changed files with 4 additions and 13 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue