From 1d397ec97794ddc273418660418a5130fc39cc27 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Wed, 18 Jun 2025 13:59:16 +0200 Subject: [PATCH] handle text margins --- client/ayon_core/tools/utils/projects_widget.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/ayon_core/tools/utils/projects_widget.py b/client/ayon_core/tools/utils/projects_widget.py index d10a68cfeb..2e3442a3dd 100644 --- a/client/ayon_core/tools/utils/projects_widget.py +++ b/client/ayon_core/tools/utils/projects_widget.py @@ -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,