summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlionelc <lionelc@lionelc.(none)>2010-08-11 18:45:34 +0200
committerlionelc <lionelc@lionelc.(none)>2010-08-11 18:45:34 +0200
commitc3001f007f031841834df0f67e654ed94389ede3 (patch)
tree0c96f9b6a21f9cd94d870c679f90cffcd9f0ae0c /src
parentloading animation color: fallback to the Highlight color if ToolTipBase color... (diff)
downloadrekonq-c3001f007f031841834df0f67e654ed94389ede3.tar.xz
loading color: (highlight + 2*background)/3
Diffstat (limited to 'src')
-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);