From: Kevin Ottens Date: Thu, 8 Oct 2020 15:39:24 +0000 (+0200) Subject: Fix the secure lock label aspect X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~109^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7efaa2ed68903a5361cfe88421b9090f786f6cd1;p=nextcloud-desktop.git Fix the secure lock label aspect Make sure we got a fixed size for that label. Also ensure that the pixmap we display there is properly scaled to fit while maintaining the aspect ratio. Signed-off-by: Kevin Ottens --- diff --git a/src/gui/wizard/owncloudsetupnocredspage.ui b/src/gui/wizard/owncloudsetupnocredspage.ui index bad3323d3..e158cc19c 100644 --- a/src/gui/wizard/owncloudsetupnocredspage.ui +++ b/src/gui/wizard/owncloudsetupnocredspage.ui @@ -221,11 +221,17 @@ - + 0 0 + + + 24 + 24 + + diff --git a/src/gui/wizard/owncloudsetuppage.cpp b/src/gui/wizard/owncloudsetuppage.cpp index 428f18a03..f286eebc1 100644 --- a/src/gui/wizard/owncloudsetuppage.cpp +++ b/src/gui/wizard/owncloudsetuppage.cpp @@ -175,14 +175,15 @@ void OwncloudSetupPage::slotUrlChanged(const QString &url) _ui.leUrl->setText(newUrl); } - if (!url.startsWith(QLatin1String("https://"))) { - _ui.urlLabel->setPixmap(QPixmap(Theme::hidpiFileName(":/client/theme/lock-http.svg"))); - _ui.urlLabel->setToolTip(tr("This URL is NOT secure as it is not encrypted.\n" - "It is not advisable to use it.")); - } else { - _ui.urlLabel->setPixmap(QPixmap(Theme::hidpiFileName(":/client/theme/lock-https.svg"))); - _ui.urlLabel->setToolTip(tr("This URL is secure. You can use it.")); - } + const auto isSecure = url.startsWith(QLatin1String("https://")); + const auto toolTip = isSecure ? tr("This URL is secure. You can use it.") + : tr("This URL is NOT secure as it is not encrypted.\n" + "It is not advisable to use it."); + const auto pixmap = isSecure ? QPixmap(Theme::hidpiFileName(":/client/theme/lock-https.svg")) + : QPixmap(Theme::hidpiFileName(":/client/theme/lock-http.svg")); + + _ui.urlLabel->setToolTip(toolTip); + _ui.urlLabel->setPixmap(pixmap.scaled(_ui.urlLabel->size(), Qt::KeepAspectRatio)); } void OwncloudSetupPage::slotUrlEditFinished()