From 1362a40d8adf82ad9633a42defd71367cdc903f6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 4 Jul 2011 23:22:05 +0200 Subject: Better notify SSL infos Positive/Negative background && KDE security icons --- src/urlbar/urlbar.cpp | 9 +++++++-- src/webpage.h | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp index 292bf6c8..fa23b6c6 100644 --- a/src/urlbar/urlbar.cpp +++ b/src/urlbar/urlbar.cpp @@ -182,7 +182,10 @@ void UrlBar::paintEvent(QPaintEvent *event) { if(_tab->url().scheme() == QL1S("https")) { - backgroundColor = colorScheme.background(KColorScheme::NeutralBackground).color(); // light yellow + backgroundColor = _tab->page()->hasSslValid() + ? colorScheme.background(KColorScheme::PositiveBackground).color() + : colorScheme.background(KColorScheme::NegativeBackground).color(); + foregroundColor = colorScheme.foreground(KColorScheme::NormalText).color(); } p.setBrush(QPalette::Base, backgroundColor); @@ -461,7 +464,9 @@ IconButton *UrlBar::addRightIcon(UrlBar::icon ic) rightIcon->setToolTip(i18n("List all available RSS feeds")); break; case UrlBar::SSL: - rightIcon->setIcon(KIcon("object-locked")); + _tab->page()->hasSslValid() + ? rightIcon->setIcon(KIcon("security-high")) + : rightIcon->setIcon(KIcon("security-low")); rightIcon->setToolTip(i18n("Show SSL Info")); break; case UrlBar::BK: diff --git a/src/webpage.h b/src/webpage.h index 3f9f27de..86355395 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -79,6 +79,11 @@ public: { return _suggestedFileName; }; + + inline bool hasSslValid() + { + return _sslInfo.isValid(); + } public Q_SLOTS: void downloadAllContentsWithKGet(QPoint); -- cgit v1.2.1