summaryrefslogtreecommitdiff
path: root/src/searchbar.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2008-12-14 18:27:17 +0100
committerAndrea Diamantini <adjam7@gmail.com>2008-12-14 18:27:17 +0100
commit19e901a0ca9630b2003dd24ccfa6da54eb70bb09 (patch)
tree6f86b9ef37a17e050c8ccf264cc69bd5865910b4 /src/searchbar.cpp
parentLast changes.. (diff)
downloadrekonq-19e901a0ca9630b2003dd24ccfa6da54eb70bb09.tar.xz
adjusted rekonq name
commented out (hopefully, for now) resizeEvents and focusInEvents in urlbar & searchbar
Diffstat (limited to 'src/searchbar.cpp')
-rw-r--r--src/searchbar.cpp46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/searchbar.cpp b/src/searchbar.cpp
index 785fcce5..29862e6d 100644
--- a/src/searchbar.cpp
+++ b/src/searchbar.cpp
@@ -1,6 +1,6 @@
/* ============================================================
 *
- * This file is a part of the reKonq project
+ * This file is a part of the rekonq project
 *
* Copyright (C) 2008 by Andrea Diamantini <adjam7 at gmail dot com>
 *
@@ -27,11 +27,17 @@
SearchBar::SearchBar(QWidget *parent) :
QWidget(parent),
- m_lineEdit(0)
+ m_lineEdit(new KLineEdit)
{
- m_lineEdit = new KLineEdit(this);
m_lineEdit->setClearButtonShown( true );
+ m_lineEdit->setFocusProxy( this );
+ setFocusPolicy( Qt::WheelFocus );
+ setMouseTracking( true );
+
+ QSizePolicy policy = sizePolicy();
+ setSizePolicy(QSizePolicy::Preferred, policy.verticalPolicy());
+
QPalette palette;
palette.setColor( QPalette::Text, Qt::gray );
m_lineEdit->setPalette( palette );
@@ -41,7 +47,7 @@ SearchBar::SearchBar(QWidget *parent) :
layout->addWidget(m_lineEdit);
setLayout(layout);
- connect( lineEdit() , SIGNAL( returnPressed() ) , this , SLOT( searchNow() ) );
+ connect( m_lineEdit , SIGNAL( returnPressed() ) , this , SLOT( searchNow() ) );
}
@@ -50,22 +56,22 @@ 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::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()