mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-03 17:35:19 +01:00
red color only for name column
This commit is contained in:
parent
21620f715f
commit
f79d497313
1 changed files with 5 additions and 4 deletions
|
|
@ -631,10 +631,6 @@ class BaseItem:
|
|||
if role == DUPLICATED_ROLE:
|
||||
return self._is_duplicated
|
||||
|
||||
if role == QtCore.Qt.ForegroundRole:
|
||||
if self._is_duplicated:
|
||||
return QtGui.QColor(255, 0, 0)
|
||||
|
||||
if role == QtCore.Qt.ToolTipRole:
|
||||
if self._is_duplicated:
|
||||
return "Asset with name \"{}\" already exists.".format(
|
||||
|
|
@ -644,6 +640,11 @@ class BaseItem:
|
|||
if key not in self.columns:
|
||||
return None
|
||||
|
||||
if role == QtCore.Qt.ForegroundRole:
|
||||
if self._is_duplicated and key == "name":
|
||||
return QtGui.QColor(255, 0, 0)
|
||||
return None
|
||||
|
||||
if role in (QtCore.Qt.DisplayRole, QtCore.Qt.EditRole):
|
||||
value = self._data[key]
|
||||
if value is None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue