From 67ed4f88998e30b90cfcb93cd8e6bd7e4d0ae7bd Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 6 Jul 2012 22:46:16 +0200 Subject: Fix adblock hide behavior NOTE: You'll find also some style & copyrights fixes here. Just reenable the git hooks scripts... BUG: 302050 --- src/urlbar/completionwidget.cpp | 11 ++++++----- src/urlbar/urlbar.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/urlbar') diff --git a/src/urlbar/completionwidget.cpp b/src/urlbar/completionwidget.cpp index 83de2f09..04f7bad0 100644 --- a/src/urlbar/completionwidget.cpp +++ b/src/urlbar/completionwidget.cpp @@ -137,19 +137,20 @@ void CompletionWidget::up() { if (_currentIndex >= 0) findChild(QString::number(_currentIndex))->deactivate(); // deactivate previous - + --_currentIndex; - if (_currentIndex < -1) { + if (_currentIndex < -1) + { _currentIndex = _list.count() - 1; } - + activateCurrentListItem(); } void CompletionWidget::down() { - if(_currentIndex >= 0) + if (_currentIndex >= 0) findChild(QString::number(_currentIndex))->deactivate(); // deactivate previous ++_currentIndex; @@ -166,7 +167,7 @@ void CompletionWidget::activateCurrentListItem() // activate "new" current ListItem *widget = findChild(QString::number(_currentIndex)); - + // update text of the url bar bar->blockSignals(true); // without compute suggestions if (widget) diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 6bf069dd..ac6665af 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -112,7 +112,7 @@ UrlBar::UrlBar(QWidget *parent) // set initial icon _icon->setIcon(KIcon("arrow-right")); - + // initial style setStyleSheet(QString("UrlBar { padding: 2px 0 2px %1px; height: %1px } ").arg(_icon->sizeHint().width())); @@ -409,7 +409,7 @@ void UrlBar::loadFinished() if (_tab->hasAdBlockedElements()) { IconButton *bt = addRightIcon(UrlBar::AdBlock); - + connect(bt, SIGNAL(clicked(QPoint)), (QObject *) rApp->adblockManager(), SLOT(showBlockedItemDialog())); } @@ -606,7 +606,7 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic) updateRightIconPosition(rightIcon, iconsCount); rightIcon->show(); - + return rightIcon; } @@ -622,7 +622,7 @@ void UrlBar::resizeEvent(QResizeEvent *event) { int ih = _icon->sizeHint().height(); int iconsCount = _rightIconsList.count(); - int iconHeight = (height() - ih) / 2; + int iconHeight = (height() - ih) / 2; _icon->move(c_iconMargin, iconHeight); -- cgit v1.2.1