diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2008-12-12 16:10:04 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2008-12-12 16:10:04 +0100 |
commit | 70809c857d125cce1d100e88d7d8ed898669a9ee (patch) | |
tree | c1c44ff4881e26d12b0db40f5bcd141b7cc8674e /src/searchbar.cpp | |
parent | 1st implementation of colored progress loading urlbar (diff) | |
download | rekonq-70809c857d125cce1d100e88d7d8ed898669a9ee.tar.xz |
Fixing searchbar dimension && position
Diffstat (limited to 'src/searchbar.cpp')
-rw-r--r-- | src/searchbar.cpp | 24 |
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(); |