From 19e901a0ca9630b2003dd24ccfa6da54eb70bb09 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 14 Dec 2008 18:27:17 +0100 Subject: adjusted rekonq name commented out (hopefully, for now) resizeEvents and focusInEvents in urlbar & searchbar --- src/searchbar.cpp | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'src/searchbar.cpp') 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  * @@ -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() -- cgit v1.2.1