summaryrefslogtreecommitdiff
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
parent1st implementation of colored progress loading urlbar (diff)
downloadrekonq-70809c857d125cce1d100e88d7d8ed898669a9ee.tar.xz
Fixing searchbar dimension && position
-rw-r--r--src/searchbar.cpp24
-rw-r--r--src/searchbar.h5
2 files changed, 25 insertions, 4 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();
diff --git a/src/searchbar.h b/src/searchbar.h
index 92f20f8e..96ae282a 100644
--- a/src/searchbar.h
+++ b/src/searchbar.h
@@ -26,7 +26,7 @@
#include <KUrl>
// Qt Includes
-#include <QWidget>
+#include <QtGui>
class SearchBar : public QWidget
{
@@ -41,6 +41,9 @@ public:
public slots:
void searchNow();
+protected:
+ void resizeEvent( QResizeEvent *);
+
private:
KLineEdit *m_lineEdit;