Update card_database_visual_view.cpp

This commit is contained in:
BruebachL 2026-11-02 18:18:07 +01:00 • committed by GitHub
parent d82143ba52
commit 153775198f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -130,11 +130,9 @@ void CardDatabaseVisualView::wheelEvent(QWheelEvent *event)
return;
}
// Whether the scroll bar is shown says nothing about whether the grid can
// scroll: macOS uses transient (overlay) scroll bars that hide themselves
// once they fade out, and Qt hides the widget for good when that happens.
// The range is the real answer; ignoring the wheel when there is nothing to
// scroll still lets an enclosing scroll area take over.
// macOS uses transient (overlay) scroll bars that hide themselves
// once they fade out, so we need to use the range to determine if we ignore the wheel when there is nothing to
// scroll. This lets an enclosing scroll area take over.
QScrollBar *bar = verticalScrollBar();
if (bar->maximum() <= bar->minimum()) {
event->ignore();