Dont reserve space for transient scrollbars
Some checks are pending
CI / Test on ${{ matrix.os }} (macos-latest) (push) Waiting to run
CI / Test on ${{ matrix.os }} (ubuntu-latest) (push) Waiting to run
CI / Test on ${{ matrix.os }} (windows-latest) (push) Waiting to run
CI / Test on Arch (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, windows-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Transifex / Update translations on Transifex (push) Waiting to run

This commit is contained in:
Kovid Goyal 2025-12-21 22:51:06 +05:30
parent 64126fd10a
commit cc2ab8bc0d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -53,6 +53,7 @@ from qt.core import (
QPoint,
QPointF,
QRect,
QStyle,
Qt,
QTimer,
pyqtSignal,
@ -949,8 +950,9 @@ class BookshelfView(MomentumScrollMixin, QAbstractScrollArea):
case QEvent.Type.Resize:
super().event(ev)
s = self.viewport().size()
s.setWidth(s.width() - self.verticalScrollBar().size().width())
self.viewport().resize(s)
if self.style().styleHint(QStyle.StyleHint.SH_ScrollBar_Transient, widget=self) == 0:
s.setWidth(s.width() - self.verticalScrollBar().size().width())
self.viewport().resize(s)
if self.layout_constraints.width != (new_width := self._get_available_width()):
self.layout_constraints = self.layout_constraints._replace(width=new_width)
self.invalidate()