mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Better fix for delegate max width calculation
Use the width of the viewport widget as that automatically excludes scrollbars.
This commit is contained in:
parent
c52246b54f
commit
dff94f6f62
@ -82,11 +82,8 @@ class UpdateEditorGeometry:
|
|||||||
is_pin_view = True
|
is_pin_view = True
|
||||||
break
|
break
|
||||||
p = p.parent()
|
p = p.parent()
|
||||||
if is_pin_view:
|
|
||||||
max_width = pin_view.horizontalScrollBar().geometry().width()
|
max_width = (pin_view if is_pin_view else self.table_widget).viewport().rect().width()
|
||||||
else:
|
|
||||||
view = self.table_widget
|
|
||||||
max_width = view.rect().width() - view.verticalHeader().width()
|
|
||||||
# What we have to display might not fit. If so, adjust down
|
# What we have to display might not fit. If so, adjust down
|
||||||
new_width = new_width if new_width < max_width else max_width
|
new_width = new_width if new_width < max_width else max_width
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user