mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
elite status name
This commit is contained in:
parent
6f2cefb8bd
commit
8979fc7608
1 changed files with 9 additions and 2 deletions
|
|
@ -186,8 +186,15 @@ class StatusDelegate(QtWidgets.QStyledItemDelegate):
|
||||||
)
|
)
|
||||||
fm = QtGui.QFontMetrics(option.font)
|
fm = QtGui.QFontMetrics(option.font)
|
||||||
if text_rect.width() < fm.width(text):
|
if text_rect.width() < fm.width(text):
|
||||||
text = self._get_status_short_name(index)
|
short_text = self._get_status_short_name(index)
|
||||||
if text_rect.width() < fm.width(text):
|
if short_text:
|
||||||
|
text = short_text
|
||||||
|
|
||||||
|
text = fm.elidedText(
|
||||||
|
text, QtCore.Qt.ElideRight, text_rect.width()
|
||||||
|
)
|
||||||
|
# Allow at least one character
|
||||||
|
if len(text) < 2:
|
||||||
text = ""
|
text = ""
|
||||||
|
|
||||||
fg_color = self._get_status_color(index)
|
fg_color = self._get_status_color(index)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue