1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

[popupwindow] Show minimal version of search toolbar.

Also set minimumWidth.
This commit is contained in:
nowrep 2013-02-10 11:25:44 +01:00
parent 67d1a8af84
commit c9bcf15f9b
4 changed files with 15 additions and 5 deletions

View File

@ -255,6 +255,7 @@ void PopupWindow::searchOnPage()
{
if (!m_search) {
m_search = new SearchToolBar(m_view, this);
m_search.data()->showMinimalInPopupWindow();
m_layout->insertWidget(m_layout->count() - 1, m_search);
}

View File

@ -60,6 +60,17 @@ void SearchToolBar::setWebView(WebView* view)
m_view = view;
}
void SearchToolBar::showMinimalInPopupWindow()
{
// Show only essentials widget + set minimum width
ui->highligh->hide();
ui->caseSensitive->hide();
ui->results->hide();
ui->horizontalLayout->setSpacing(2);
ui->horizontalLayout->setContentsMargins(2, 6, 2, 6);
setMinimumWidth(260);
}
void SearchToolBar::focusSearchLine()
{
ui->lineEdit->setFocus();

View File

@ -41,6 +41,7 @@ public:
~SearchToolBar();
void setWebView(WebView* view);
void showMinimalInPopupWindow();
void focusSearchLine();
bool eventFilter(QObject* obj, QEvent* event);

View File

@ -114,13 +114,10 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>5</width>
<height>1</height>
</size>
</property>
</spacer>