]> cloud.milkyroute.net Git - dolphin.git/commitdiff
AnimatedHeightWidget: Disable scrollbars
authorAkseli Lahtinen <akselmo@akselmo.dev>
Fri, 13 Jun 2025 10:46:40 +0000 (13:46 +0300)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Thu, 19 Jun 2025 16:07:19 +0000 (19:07 +0300)
QScrollArea is used to avoid increasing view width, and not for actual
scroll reasons.

We should therefore disallow scrolling the view entirely, since this
causes bugs with being able to scroll random views.

BUG: 504252

src/animatedheightwidget.cpp

index f1631bb6fa4764f84d6cb3b21e1e9cfa862ace6f..cd62f39715b621a3fa8fe1c38bb3398e6db4d6e5 100644 (file)
@@ -10,6 +10,7 @@
 #include <QGridLayout>
 #include <QPropertyAnimation>
 #include <QScrollArea>
+#include <QScrollBar>
 #include <QStyle>
 
 AnimatedHeightWidget::AnimatedHeightWidget(QWidget *parent)
@@ -30,6 +31,9 @@ AnimatedHeightWidget::AnimatedHeightWidget(QWidget *parent)
     m_contentsContainerParent->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     m_contentsContainerParent->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     m_contentsContainerParent->setWidgetResizable(true);
+    // Disables manual scrolling, for example with mouse scrollwheel.
+    m_contentsContainerParent->verticalScrollBar()->setEnabled(false);
+    m_contentsContainerParent->horizontalScrollBar()->setEnabled(false);
 
     setMinimumWidth(0);
 }