diff options
Diffstat (limited to 'src/urlbar/urlbar.cpp')
-rw-r--r-- | src/urlbar/urlbar.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index e1e542b7..d2992c4d 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); @@ -190,7 +186,7 @@ void UrlBar::paintEvent(QPaintEvent *event) // you need this before our code to draw inside the line edit.. KLineEdit::paintEvent(event); - if (text().isEmpty()) + if( text().isEmpty() && progr == 0 ) { QStyleOptionFrame option; initStyleOption(&option); @@ -305,7 +301,7 @@ void UrlBar::loadFinished() void UrlBar::loadTyped(const QString &text) { - activated(KUrl(text)); + activated( KUrl(text) ); } @@ -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(); @@ -392,17 +389,20 @@ void UrlBar::resizeEvent(QResizeEvent *event) } KLineEdit::resizeEvent(event); - } void UrlBar::detectTypedString(const QString &typed) { - Q_UNUSED(typed); + if(typed.count() == 1) + { + QTimer::singleShot(0, this, SLOT(suggest())); + return; + } if(_suggestionTimer->isActive()) _suggestionTimer->stop(); - _suggestionTimer->start(200); + _suggestionTimer->start(150); } @@ -410,4 +410,4 @@ void UrlBar::suggest() { if(!_box.isNull()) _box.data()->suggestUrls( text() ); -}
\ No newline at end of file +} |