1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01: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) { if (!m_search) {
m_search = new SearchToolBar(m_view, this); m_search = new SearchToolBar(m_view, this);
m_search.data()->showMinimalInPopupWindow();
m_layout->insertWidget(m_layout->count() - 1, m_search); m_layout->insertWidget(m_layout->count() - 1, m_search);
} }

View File

@ -60,6 +60,17 @@ void SearchToolBar::setWebView(WebView* view)
m_view = 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() void SearchToolBar::focusSearchLine()
{ {
ui->lineEdit->setFocus(); ui->lineEdit->setFocus();

View File

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

View File

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