From a835a88d397ae90a2d9d8a928da3784a531c44ce Mon Sep 17 00:00:00 2001 From: lionelc Date: Wed, 11 Aug 2010 16:46:16 +0200 Subject: loading animation color: fallback to the Highlight color if ToolTipBase color is quiet the same as Text color --- src/urlbar/urlbar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index bc43957a..c5b89516 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -186,7 +186,11 @@ void UrlBar::paintEvent(QPaintEvent *event) else { QColor loadingColor = Application::palette().color(QPalette::ToolTipBase); - + if (abs(loadingColor.lightness() - foregroundColor.lightness()) < 50) + { + loadingColor = Application::palette().color(QPalette::Highlight); + } + QLinearGradient gradient( QPoint(0, 0), QPoint(width(), 0) ); gradient.setColorAt(0, loadingColor); gradient.setColorAt(((double)progr) / 100 - .000001, loadingColor); -- cgit v1.2.1