From eb38b53c0400e54b17da7777d423736eff0a3cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BB?= Date: Wed, 14 Aug 2019 18:03:42 +0000 Subject: [PATCH] Fix Settings UI inconsistencies (#1202) * Move "About" tab in Settings * Resize Settings window This prevents from spawning horizontal scroll (which is caused by too long line in "Attributions" group) * Fix "show license" link width If you clicked empty space next to link application assumed you clicked link. I fixed that by using QLabels instead of SignalLabel (there's something "wrong" with them, but I couldn't find what) --- src/widgets/dialogs/SettingsDialog.cpp | 5 +++-- src/widgets/settingspages/AboutPage.cpp | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index 77872e3a6..69536bede 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -38,7 +38,7 @@ SettingsDialog::SettingsDialog() this->overrideBackgroundColor_ = QColor("#111111"); this->themeChangedEvent(); - this->resize(766, 600); + this->resize(815, 600); } void SettingsDialog::initUi() @@ -54,7 +54,7 @@ void SettingsDialog::initUi() .withoutMargin() .assign(&this->ui_.tabContainer); - this->ui_.tabContainerContainer->layout()->setContentsMargins(8, 8, 0, 8); + this->ui_.tabContainerContainer->layout()->setContentsMargins(8, 8, 0, 39); this->layout()->setSpacing(0); @@ -129,6 +129,7 @@ void SettingsDialog::addTabs() this->ui_.tabContainer->addStretch(1); this->addTab(new AboutPage, Qt::AlignBottom); + this->ui_.tabContainer->addSpacing(16); } void SettingsDialog::addTab(SettingsPage *page, Qt::Alignment alignment) diff --git a/src/widgets/settingspages/AboutPage.cpp b/src/widgets/settingspages/AboutPage.cpp index a8576b240..a69da6ba1 100644 --- a/src/widgets/settingspages/AboutPage.cpp +++ b/src/widgets/settingspages/AboutPage.cpp @@ -205,10 +205,8 @@ void AboutPage::addLicense(QFormLayout *form, const QString &name, { auto *a = new QLabel("" + name + ""); a->setOpenExternalLinks(true); - auto *b = new SignalLabel(); - b->setText("show license"); - b->setCursor(Qt::PointingHandCursor); - QObject::connect(b, &SignalLabel::mouseUp, [licenseLink] { + auto *b = new QLabel("show license"); + QObject::connect(b, &QLabel::linkActivated, [licenseLink] { auto *edit = new QTextEdit; QFile file(licenseLink);