summaryrefslogtreecommitdiff
path: root/src/searchbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/searchbar.cpp')
-rw-r--r--src/searchbar.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/searchbar.cpp b/src/searchbar.cpp
index a48803b3..785fcce5 100644
--- a/src/searchbar.cpp
+++ b/src/searchbar.cpp
@@ -21,9 +21,9 @@
#include "searchbar.h"
#include "searchbar.moc"
-// Qt Includes
-#include <QVBoxLayout>
-#include <QPalette>
+#include "browserapplication.h"
+#include "browsermainwindow.h"
+
SearchBar::SearchBar(QWidget *parent) :
QWidget(parent),
@@ -50,6 +50,24 @@ SearchBar::~SearchBar()
}
+void SearchBar::resizeEvent( QResizeEvent * event )
+{
+ QRect rect = m_lineEdit->contentsRect();
+
+ int width = rect.width();
+
+ int lineEditWidth = BrowserApplication::instance()->mainWindow()->size().width() / 5 ; // FIXME ( OR not?)
+
+ m_lineEdit->setGeometry( rect.x() + ( width - lineEditWidth + 8 ),
+ rect.y() + 4,
+ lineEditWidth,
+ m_lineEdit->height()
+ );
+
+ QWidget::resizeEvent( event );
+}
+
+
void SearchBar::searchNow()
{
QString searchText = m_lineEdit->text();