Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@nextcloud.com>2020-10-08 18:39:24 +0300
committerKevin Ottens <kevin.ottens@nextcloud.com>2020-10-13 08:28:32 +0300
commit7efaa2ed68903a5361cfe88421b9090f786f6cd1 (patch)
tree117d0f63dc29c93bf6863c442a2f72a3b1b40521 /src/gui
parentec945b8ac784824d1d236afda52ab35e422156a7 (diff)
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 <kevin.ottens@nextcloud.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/wizard/owncloudsetupnocredspage.ui8
-rw-r--r--src/gui/wizard/owncloudsetuppage.cpp17
2 files changed, 16 insertions, 9 deletions
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 @@
<item>
<widget class="QLabel" name="urlLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
<property name="text">
<string/>
</property>
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()