diff options
Diffstat (limited to 'src/urlbar.cpp')
-rw-r--r-- | src/urlbar.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/urlbar.cpp b/src/urlbar.cpp index 28c63b78..94f248e3 100644 --- a/src/urlbar.cpp +++ b/src/urlbar.cpp @@ -225,7 +225,7 @@ void UrlBar::paintEvent(QPaintEvent *event) painter.setPen(Qt::transparent); QRect backgroundRect = lineEdit()->frameGeometry(); - int mid = backgroundRect.width() / 100 * m_progress; + int mid = backgroundRect.width() * m_progress / 100; QRect progressRect(backgroundRect.x(), backgroundRect.y(), mid, backgroundRect.height()); painter.drawRect(progressRect); painter.end(); @@ -244,10 +244,7 @@ void UrlBar::focusOutEvent(QFocusEvent *event) QSize UrlBar::sizeHint() const { - QSize size(lineEdit()->sizeHint()); - // make it (more or less) the same height with search bar (at least on oxygen) -// size.setHeight(size.height() + 2); - return size; + return lineEdit()->sizeHint(); } @@ -266,9 +263,19 @@ QLinearGradient UrlBar::generateGradient(const QColor &color, int height) return gradient; } + void UrlBar::setBackgroundColor(QColor c) { s_defaultBaseColor=c; repaint(); } + +bool UrlBar::isLoading() +{ + if(m_progress == 0) + { + return false; + } + return true; +} |