summaryrefslogtreecommitdiff
path: root/src/urlbar
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-08-12 11:32:27 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-08-12 11:32:27 +0200
commit21d6f876ae223a1f477f7abe36a6e395ce535a4a (patch)
treefa84b691f3b4682b7d66a6226162715499e76865 /src/urlbar
parentMerge commit 'refs/merge-requests/163' of git://gitorious.org/rekonq/mainline (diff)
parentloading color: (highlight + 2*background)/3 (diff)
downloadrekonq-21d6f876ae223a1f477f7abe36a6e395ce535a4a.tar.xz
Merge commit 'refs/merge-requests/164' of git://gitorious.org/rekonq/mainline into m164
Diffstat (limited to 'src/urlbar')
-rw-r--r--src/urlbar/urlbar.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 5c3cba28..d924a30d 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -185,9 +185,23 @@ void UrlBar::paintEvent(QPaintEvent *event)
}
else
{
- QColor loadingColor = Application::palette().color(QPalette::ToolTipBase);
+ QColor highlight = Application::palette().color(QPalette::Highlight);
- QLinearGradient gradient( QPoint(0, 0), QPoint(width(), height()) );
+ 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
+ {
+ 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);
gradient.setColorAt(((double)progr) / 100, backgroundColor);