1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Use security state icon in popup location bar

Reviewers: drosca

Reviewed By: drosca

Subscribers: falkon

Tags: #falkon

Differential Revision: https://phabricator.kde.org/D12666
This commit is contained in:
Anmol Gautam 2018-05-02 21:40:56 +05:30
parent dd8d8b9007
commit b6edd26ca0
3 changed files with 12 additions and 1 deletions

View File

@ -106,5 +106,14 @@ void PopupLocationBar::showUrl(const QUrl &url)
void PopupLocationBar::showSiteIcon() void PopupLocationBar::showSiteIcon()
{ {
m_siteIcon->setIcon(m_view->icon()); QIcon icon = IconProvider::emptyWebIcon();
if (property("secured").toBool()) {
icon = QIcon::fromTheme(QSL("document-encrypted"), icon);
}
m_siteIcon->setIcon(QIcon(icon.pixmap(16)));
}
void PopupLocationBar::setPrivacyState(bool state)
{
setProperty("secured", QVariant(state));
} }

View File

@ -46,6 +46,7 @@ public:
public Q_SLOTS: public Q_SLOTS:
void showUrl(const QUrl &url); void showUrl(const QUrl &url);
void showSiteIcon(); void showSiteIcon();
void setPrivacyState(bool state);
private: private:
PopupWebView* m_view; PopupWebView* m_view;

View File

@ -143,6 +143,7 @@ PopupWindow::PopupWindow(PopupWebView* view)
connect(m_view, &WebView::loadStarted, this, &PopupWindow::loadStarted); connect(m_view, &WebView::loadStarted, this, &PopupWindow::loadStarted);
connect(m_view, &WebView::loadProgress, this, &PopupWindow::loadProgress); connect(m_view, &WebView::loadProgress, this, &PopupWindow::loadProgress);
connect(m_view, &WebView::loadFinished, this, &PopupWindow::loadFinished); connect(m_view, &WebView::loadFinished, this, &PopupWindow::loadFinished);
connect(m_view, &WebView::privacyChanged, m_locationBar, &PopupLocationBar::setPrivacyState);
auto pageChanged = [this](WebPage *page) { auto pageChanged = [this](WebPage *page) {
connect(page, &WebPage::linkHovered, this, &PopupWindow::showStatusBarMessage); connect(page, &WebPage::linkHovered, this, &PopupWindow::showStatusBarMessage);