Better fix for delegate max width calculation

Use the width of the viewport widget as that automatically excludes
scrollbars.
This commit is contained in:
Kovid Goyal 2024-01-20 08:24:36 +05:30
parent c52246b54f
commit dff94f6f62
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -82,11 +82,8 @@ class UpdateEditorGeometry:
is_pin_view = True
break
p = p.parent()
if is_pin_view:
max_width = pin_view.horizontalScrollBar().geometry().width()
else:
view = self.table_widget
max_width = view.rect().width() - view.verticalHeader().width()
max_width = (pin_view if is_pin_view else self.table_widget).viewport().rect().width()
# What we have to display might not fit. If so, adjust down
new_width = new_width if new_width < max_width else max_width