diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2008-12-16 01:09:39 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2008-12-16 01:09:39 +0100 |
commit | af9623896acb241a965a7d0823e12fd099031a39 (patch) | |
tree | 1c8a455631070d29bc2526a0015cb45c8b7ab5fc /src/urlbar.cpp | |
parent | Some improvements in settings class.. (diff) | |
download | rekonq-af9623896acb241a965a7d0823e12fd099031a39.tar.xz |
Initial solution for UI resizing..
Now we can release rekonq 0.0.2 and thinking later about the problem..
Diffstat (limited to 'src/urlbar.cpp')
-rw-r--r-- | src/urlbar.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/urlbar.cpp b/src/urlbar.cpp index 85e59693..e2dc458d 100644 --- a/src/urlbar.cpp +++ b/src/urlbar.cpp @@ -26,24 +26,19 @@ UrlBar::UrlBar(QWidget *parent) - : QWidget(parent) - , m_historyComboBox( new KHistoryComboBox( true, parent ) ) + : KHistoryComboBox( true, parent ) , m_webView(0) , m_lineEdit(new QLineEdit) { - m_historyComboBox->setLineEdit( m_lineEdit ); + setLineEdit( m_lineEdit ); QSizePolicy policy = sizePolicy(); setSizePolicy(QSizePolicy::Preferred, policy.verticalPolicy()); - QVBoxLayout *layout = new QVBoxLayout; - layout->addWidget( m_historyComboBox ); - setLayout(layout); - m_defaultBaseColor = palette().color( QPalette::Base ); // add every item to history - connect( m_historyComboBox, SIGNAL( activated( const QString& ) ), m_historyComboBox, SLOT( addToHistory( const QString& ) ) ); + connect( this, SIGNAL( activated( const QString& ) ), this, SLOT( addToHistory( const QString& ) ) ); webViewIconChanged(); } @@ -91,8 +86,8 @@ void UrlBar::webViewIconChanged() QIcon urlIcon = QIcon(pixmap); // FIXME simple hack to show Icon in the urlbar, as calling changeUrl() doesn't affect it - m_historyComboBox->removeItem( 0 ); - m_historyComboBox->insertUrl( 0 , urlIcon , url ); + removeItem( 0 ); + insertUrl( 0 , urlIcon , url ); } @@ -138,17 +133,19 @@ QLinearGradient UrlBar::generateGradient(const QColor &color) const // } -// void UrlBar::resizeEvent( QResizeEvent *event ) +// FIXME : seems working. Need to re-enable it when searchbar resizing will work , too.. +// void UrlBar::resizeEvent( QResizeEvent * event ) // { -// QRect rect = m_historyComboBox->frameGeometry(); -// -// int newWidth = BrowserApplication::instance()->mainWindow()->size().width() * 3 / 5 ; // FIXME ( OR not?) +// QRect rect = geometry(); // -// m_historyComboBox->setGeometry( rect.x(), -// rect.y(), -// newWidth, -// m_historyComboBox->height() -// ); +// int windowWidth = BrowserApplication::instance()->mainWindow()->size().width() ; // FIXME ( OR not?) +// int newWidth = windowWidth * 4 / 6; +// +// setGeometry( rect.x() + 1, +// rect.y() + 1, +// newWidth, +// height() +// ); // -// QWidget::resizeEvent( event ); +// KHistoryComboBox::resizeEvent( event ); // } |