add hardening, zoom and useragent options
This commit is contained in:
+16
-11
@@ -34,10 +34,12 @@ void StatusBar::setMode(const QString &mode)
|
||||
m_mode->setVisible(!mode.isEmpty());
|
||||
}
|
||||
|
||||
void StatusBar::setUrl(const QString &url)
|
||||
void StatusBar::setUrl(const QUrl &url)
|
||||
{
|
||||
m_urlText = url;
|
||||
m_url->setText(url);
|
||||
m_urlText = url.toDisplayString();
|
||||
m_insecure = url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("ws");
|
||||
setUrlLabelState(false, m_insecure);
|
||||
m_url->setText(m_urlText);
|
||||
}
|
||||
|
||||
void StatusBar::setProgress(int percent)
|
||||
@@ -49,20 +51,23 @@ void StatusBar::setProgress(int percent)
|
||||
|
||||
void StatusBar::showMessage(const QString &message, bool isError)
|
||||
{
|
||||
m_url->setProperty("error", isError);
|
||||
setUrlLabelState(isError, false);
|
||||
m_url->setText(message);
|
||||
|
||||
// Re-polish so the stylesheet picks up the changed property.
|
||||
m_url->style()->unpolish(m_url);
|
||||
m_url->style()->polish(m_url);
|
||||
|
||||
QTimer::singleShot(4000, this, &StatusBar::clearMessage);
|
||||
}
|
||||
|
||||
void StatusBar::clearMessage()
|
||||
{
|
||||
m_url->setProperty("error", false);
|
||||
m_url->style()->unpolish(m_url);
|
||||
m_url->style()->polish(m_url);
|
||||
setUrlLabelState(false, m_insecure);
|
||||
m_url->setText(m_urlText);
|
||||
}
|
||||
|
||||
void StatusBar::setUrlLabelState(bool error, bool insecure)
|
||||
{
|
||||
m_url->setProperty("error", error);
|
||||
m_url->setProperty("insecure", insecure);
|
||||
// Re-polish so the stylesheet picks up the changed properties.
|
||||
m_url->style()->unpolish(m_url);
|
||||
m_url->style()->polish(m_url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user