summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/urlbar/urlbar.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index c5b89516..d924a30d 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -185,12 +185,22 @@ void UrlBar::paintEvent(QPaintEvent *event)
}
else
{
- QColor loadingColor = Application::palette().color(QPalette::ToolTipBase);
- if (abs(loadingColor.lightness() - foregroundColor.lightness()) < 50)
+ QColor highlight = Application::palette().color(QPalette::Highlight);
+
+ int r = (highlight.red()+2*backgroundColor.red())/3;
+ int g = (highlight.green()+2*backgroundColor.green())/3;
+ int b = (highlight.blue()+2*backgroundColor.blue())/3;
+
+ QColor loadingColor(r, g, b);
+
+ if (abs(loadingColor.lightness() - backgroundColor.lightness()) < 20) //eg. Gaia color scheme
{
- loadingColor = Application::palette().color(QPalette::Highlight);
+ r = (2*highlight.red()+backgroundColor.red())/3;
+ g = (2*highlight.green()+backgroundColor.green())/3;
+ b = (2*highlight.blue()+backgroundColor.blue())/3;
+ loadingColor = QColor(r, g, b);
}
-
+
QLinearGradient gradient( QPoint(0, 0), QPoint(width(), 0) );
gradient.setColorAt(0, loadingColor);
gradient.setColorAt(((double)progr) / 100 - .000001, loadingColor);