From af265c6077c909caa617b485c2a5ebf409c3f5a0 Mon Sep 17 00:00:00 2001 From: pax Date: Wed, 8 Apr 2026 21:26:01 -0500 Subject: [PATCH] Revert "grid: force vertical scrollbar AlwaysOn to fix column-collapse race" This reverts commit 69f75fc98fa2817f9ccfd4809475299a1e41f89a. --- booru_viewer/gui/grid.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/booru_viewer/gui/grid.py b/booru_viewer/gui/grid.py index 01fd61e..dec992d 100644 --- a/booru_viewer/gui/grid.py +++ b/booru_viewer/gui/grid.py @@ -364,18 +364,6 @@ class ThumbnailGrid(QScrollArea): self.setWidget(self._flow) self.setWidgetResizable(True) self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff) - # Force the vertical scrollbar to always be visible so its width - # is always reserved in the viewport. With the default - # ScrollBarAsNeeded, the viewport width drops by ~14-16px when - # the scrollbar first appears, and FlowLayout's column count - # (computed as `viewport.width() // (THUMB_SIZE + THUMB_SPACING)`) - # flips down by 1 if the grid width was sitting within a - # scrollbar-width of a column boundary. Visible symptom: the - # grid collapses by a column the first time content overflows. - # AlwaysOn keeps the scrollbar's width reserved permanently so - # the column math is stable across the scrollbar visibility - # transition. - self.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOn) self._thumbs: list[ThumbnailWidget] = [] self._selected_index = -1 self._multi_selected: set[int] = set()