From f843422c46a9efa5d3f50d4cdb99a5e4ee71769f Mon Sep 17 00:00:00 2001 From: Felix Rohrbach Date: Mon, 21 Mar 2011 22:51:24 +0100 Subject: Better color integration for the urlbar and the findbar BUG:256535 --- src/findbar.cpp | 8 +++++--- src/urlbar/urlbar.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/findbar.cpp b/src/findbar.cpp index ebb6e641..8272a2d3 100644 --- a/src/findbar.cpp +++ b/src/findbar.cpp @@ -40,6 +40,7 @@ #include #include #include +#include // Qt Includes #include @@ -189,20 +190,21 @@ void FindBar::setVisible(bool visible) void FindBar::notifyMatch(bool match) { QPalette p = m_lineEdit->palette(); + KColorScheme colorScheme(p.currentColorGroup()); if (m_lineEdit->text().isEmpty()) { - p.setColor(QPalette::Base, QColor(KApplication::palette().color(QPalette::Active, QPalette::Base))); + p.setColor(QPalette::Base, colorScheme.background(KColorScheme::NormalBackground).color()); } else { if (match) { - p.setColor(QPalette::Base, QColor(186, 249, 206)); + p.setColor(QPalette::Base, colorScheme.background(KColorScheme::PositiveBackground).color()); } else { - p.setColor(QPalette::Base, QColor(247, 130, 130)); // previous were 247, 230, 230 + p.setColor(QPalette::Base, colorScheme.background(KColorScheme::NegativeBackground).color()); // previous were 247, 230, 230 } } m_lineEdit->setPalette(p); diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 8f3e11ec..18ed9aaf 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -49,6 +49,7 @@ // KDE Includes #include #include +#include // Qt Includes #include @@ -154,6 +155,7 @@ void UrlBar::activated(const KUrl& url, Rekonq::OpenType type) void UrlBar::paintEvent(QPaintEvent *event) { + KColorScheme colorScheme(palette().currentColorGroup()); QColor backgroundColor; QColor foregroundColor; @@ -176,8 +178,8 @@ void UrlBar::paintEvent(QPaintEvent *event) { if (_tab->url().scheme() == QL1S("https")) { - backgroundColor = QColor(255, 255, 171); // light yellow - foregroundColor = Qt::black; + backgroundColor = colorScheme.background(KColorScheme::NeutralBackground).color(); // light yellow + foregroundColor = colorScheme.foreground(KColorScheme::NormalText).color(); } p.setBrush(QPalette::Base, backgroundColor); p.setBrush(QPalette::Text, foregroundColor); -- cgit v1.2.1