mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge pull request #1439 from ynput/enhancement/elide-status-name-text
Loader: Elide status name text
This commit is contained in:
commit
1528cc6364
1 changed files with 9 additions and 2 deletions
|
|
@ -186,8 +186,15 @@ class StatusDelegate(QtWidgets.QStyledItemDelegate):
|
|||
)
|
||||
fm = QtGui.QFontMetrics(option.font)
|
||||
if text_rect.width() < fm.width(text):
|
||||
text = self._get_status_short_name(index)
|
||||
if text_rect.width() < fm.width(text):
|
||||
short_text = self._get_status_short_name(index)
|
||||
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 = ""
|
||||
|
||||
fg_color = self._get_status_color(index)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue