]> cloud.milkyroute.net Git - dolphin.git/commitdiff
search: Prevent the search box from enlarging the view
authorIsmael Asensio <isma.af@gmail.com>
Fri, 3 Mar 2023 22:49:19 +0000 (23:49 +0100)
committerIsmael Asensio <isma.af@gmail.com>
Sat, 4 Mar 2023 10:30:41 +0000 (10:30 +0000)
By default, the search filters widget calculates its
`minimumSizeHint` as the sum of its components' minimum widths.

This minimum width hint will scale up the widgets hierarchy,
finally imposing a minimum width to the contents view, which
in certain conditions can take the space from the side panels.

Let's set a minimum width hint of 0, so it is the filters widget
which always adapts to the available view size instead.

BUG: 466796
FIXED-IN: 23.04

src/search/dolphinfacetswidget.cpp
src/search/dolphinfacetswidget.h

index ffc07442a2bbecb55e857ffe3090cc29748ab96a..501f3a956e52715bfae3f3fd50ae45064e270a82 100644 (file)
@@ -104,6 +104,11 @@ void DolphinFacetsWidget::changeEvent(QEvent *event)
     }
 }
 
+QSize DolphinFacetsWidget::minimumSizeHint() const
+{
+    return QSize(0, m_typeSelector->minimumHeight());
+}
+
 void DolphinFacetsWidget::resetSearchTerms()
 {
     m_typeSelector->setCurrentIndex(0);
index 1d266ac97a5587d94735a628a51f0f36ecdf62f8..c7358e2125fe869ed6985a505e013b326b246ca0 100644 (file)
@@ -48,6 +48,8 @@ public:
 
     void setFacetType(const QString &type);
 
+    QSize minimumSizeHint() const override;
+
 Q_SIGNALS:
     void facetChanged();