From 0576f6b1542b80963afa20227c7fe53e53f111e8 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 14 May 2010 19:56:26 +0200 Subject: This commit reintroduces the QStackedWidget class for urlbars and let us resize them as needed for themes different from oxygen. This anyway seems working better with the upcoming Qt 4.7 --- src/urlbar/urlbar.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/urlbar/urlbar.cpp') diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index f11cfdeb..fb98076a 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -61,6 +61,7 @@ IconButton::IconButton(QWidget *parent) setCursor(Qt::ArrowCursor); } + void IconButton::mouseReleaseEvent(QMouseEvent* event) { emit clicked(event->globalPos()); @@ -80,11 +81,6 @@ UrlBar::UrlBar(QWidget *parent) // initial style setStyleSheet(QString("UrlBar { padding: 0 0 0 %1px;} ").arg(_icon->sizeHint().width())); - // cosmetic - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - setMinimumWidth(200); - setMinimumHeight(26); - // doesn't show the clear button setClearButtonShown(false); @@ -363,7 +359,8 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic) _rightIconsList << rightIcon; int iconsCount = _rightIconsList.count(); - rightIcon->move(width() - 23*iconsCount, 6); + int iconHeight = (height() - 18) / 2; + rightIcon->move(width() - 23*iconsCount, iconHeight); rightIcon->show(); return rightIcon; @@ -379,7 +376,7 @@ void UrlBar::clearRightIcons() void UrlBar::resizeEvent(QResizeEvent *event) { - int newHeight = (height() - 19) / 2; + int newHeight = (height() - 18) / 2; _icon->move(4, newHeight); int iconsCount = _rightIconsList.count(); -- cgit v1.2.1