summaryrefslogtreecommitdiff
path: root/src/searchbar.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2008-12-12 16:10:04 +0100
committerAndrea Diamantini <adjam7@gmail.com>2008-12-12 16:10:04 +0100
commit70809c857d125cce1d100e88d7d8ed898669a9ee (patch)
treec1c44ff4881e26d12b0db40f5bcd141b7cc8674e /src/searchbar.cpp
parent1st implementation of colored progress loading urlbar (diff)
downloadrekonq-70809c857d125cce1d100e88d7d8ed898669a9ee.tar.xz
Fixing searchbar dimension && position
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();