mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Settings dialog: Move detailed version info from About section to Legal notice dialog
- Enlarge dialog widget to show full content - Implement Dark-/Light-Mode switching (hyperlinks) Signed-off-by: Michael Schuster <michael@schuster.ms>
This commit is contained in:
parent
2adde0fcca
commit
d8c407ac97
3 changed files with 43 additions and 11 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "legalnotice.h"
|
||||
#include "ui_legalnotice.h"
|
||||
#include "theme.h"
|
||||
|
||||
namespace OCC {
|
||||
|
||||
|
@ -24,16 +25,9 @@ LegalNotice::LegalNotice(QDialog *parent)
|
|||
{
|
||||
_ui->setupUi(this);
|
||||
|
||||
QString notice = tr("<p>Copyright 2017-2020 Nextcloud GmbH<br />"
|
||||
"Copyright 2012-2018 ownCloud GmbH</p>");
|
||||
|
||||
notice += tr("<p>Licensed under the GNU General Public License (GPL) Version 2.0 or any later version.</p>");
|
||||
|
||||
_ui->notice->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
|
||||
_ui->notice->setText(notice);
|
||||
_ui->notice->setWordWrap(true);
|
||||
|
||||
connect(_ui->closeButton, &QPushButton::clicked, this, &LegalNotice::accept);
|
||||
|
||||
customizeStyle();
|
||||
}
|
||||
|
||||
LegalNotice::~LegalNotice()
|
||||
|
@ -41,4 +35,37 @@ LegalNotice::~LegalNotice()
|
|||
delete _ui;
|
||||
}
|
||||
|
||||
void LegalNotice::changeEvent(QEvent *e)
|
||||
{
|
||||
switch (e->type()) {
|
||||
case QEvent::StyleChange:
|
||||
case QEvent::PaletteChange:
|
||||
case QEvent::ThemeChange:
|
||||
customizeStyle();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QDialog::changeEvent(e);
|
||||
}
|
||||
|
||||
void LegalNotice::customizeStyle()
|
||||
{
|
||||
QString notice = tr("<p>Copyright 2017-2020 Nextcloud GmbH<br />"
|
||||
"Copyright 2012-2018 ownCloud GmbH</p>");
|
||||
|
||||
notice += tr("<p>Licensed under the GNU General Public License (GPL) Version 2.0 or any later version.</p>");
|
||||
|
||||
notice += "<p> </p>";
|
||||
notice += Theme::instance()->aboutDetails();
|
||||
|
||||
Theme::replaceLinkColorStringBackgroundAware(notice);
|
||||
|
||||
_ui->notice->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
|
||||
_ui->notice->setText(notice);
|
||||
_ui->notice->setWordWrap(true);
|
||||
_ui->notice->setOpenExternalLinks(true);
|
||||
}
|
||||
|
||||
} // namespace OCC
|
||||
|
|
|
@ -37,7 +37,12 @@ public:
|
|||
explicit LegalNotice(QDialog *parent = nullptr);
|
||||
~LegalNotice();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *) override;
|
||||
|
||||
private:
|
||||
void customizeStyle();
|
||||
|
||||
Ui::LegalNotice *_ui;
|
||||
};
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>291</width>
|
||||
<height>260</height>
|
||||
<width>591</width>
|
||||
<height>360</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
Loading…
Reference in a new issue