diff options
| author | Peter Penz <[email protected]> | 2011-01-23 15:03:52 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-01-23 15:03:52 +0000 |
| commit | 20664d8b723a093b5af359212bf550d63bcac1cb (patch) | |
| tree | 02e9a6ed7c6904e10209452c64d0ff11d0da11c6 /src/search | |
| parent | 8653fc7f874137791f93b609b5196cbd99457331 (diff) | |
Prevent that the view is forced to increase its width when the searching is enabled and not enough width is available for all options.
svn path=/trunk/KDE/kdebase/apps/; revision=1216467
Diffstat (limited to 'src/search')
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index bc1445cb7..039c16ded 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -34,6 +34,7 @@ #include <QKeyEvent> #include <QLabel> #include <QPushButton> +#include <QScrollArea> #include <QTimer> #include <QToolButton> #include <QVBoxLayout> @@ -299,9 +300,22 @@ void DolphinSearchBox::init() optionsLayout->addWidget(m_everywhereButton); optionsLayout->addStretch(1); + // Put the options into a QScrollArea. This prevents increasing the view width + // in case that not enough width for the options is available. + QWidget* optionsContainer = new QWidget(this); + optionsContainer->setLayout(optionsLayout); + QScrollArea* optionsScrollArea = new QScrollArea(this); + optionsScrollArea->setFrameShape(QFrame::NoFrame); + optionsScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + optionsScrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + optionsScrollArea->setMaximumHeight(optionsContainer->sizeHint().height()); + optionsScrollArea->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + optionsScrollArea->setWidget(optionsContainer); + optionsScrollArea->setWidgetResizable(true); + m_topLayout = new QVBoxLayout(this); m_topLayout->addLayout(searchInputLayout); - m_topLayout->addLayout(optionsLayout); + m_topLayout->addWidget(optionsScrollArea); searchLabel->setBuddy(m_searchInput); loadSettings(); |
