mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
handle text margins
This commit is contained in:
parent
79553d0ce7
commit
1d397ec977
1 changed files with 6 additions and 0 deletions
|
|
@ -563,6 +563,12 @@ class ProjectsDelegate(QtWidgets.QStyledItemDelegate):
|
|||
painter.setPen(opt.palette.color(cg, QtGui.QPalette.Text))
|
||||
painter.drawRect(text_rect.adjusted(0, 0, -1, -1))
|
||||
|
||||
margin = proxy.pixelMetric(
|
||||
QtWidgets.QStyle.PM_FocusFrameHMargin, None, widget
|
||||
) + 1
|
||||
text_rect.adjust(margin, 0, -margin, 0)
|
||||
# NOTE skipping some steps e.g. word wrapping and elided
|
||||
# text (adding '...' when too long).
|
||||
painter.drawText(
|
||||
text_rect,
|
||||
opt.displayAlignment,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue