diff options
author | 2021-04-07 21:47:26 +0530 | |
---|---|---|
committer | 2021-04-07 21:47:26 +0530 | |
commit | 45f71bc6abada7ad8eb0515959aa667208d78faf (patch) | |
tree | 35b052037da1f3209f8c92e39add7c153c7dcf72 /src/about.cpp | |
parent | 3808c7afabaf3217b2641083cc3a07e771848eaa (diff) | |
download | whatsie-45f71bc6abada7ad8eb0515959aa667208d78faf.tar.gz whatsie-45f71bc6abada7ad8eb0515959aa667208d78faf.zip |
added debug info widget in about dialog
Diffstat (limited to 'src/about.cpp')
-rw-r--r-- | src/about.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/about.cpp b/src/about.cpp index c49e68b..b48c7e2 100644 --- a/src/about.cpp +++ b/src/about.cpp @@ -3,7 +3,9 @@ #include <QDesktopServices> #include <QGraphicsOpacityEffect> #include <QPropertyAnimation> +#include <QTimer> #include <QUrl> +#include <utils.h> About::About(QWidget *parent) : QWidget(parent), @@ -11,6 +13,11 @@ About::About(QWidget *parent) : { ui->setupUi(this); + ui->debugInfoText->setHtml(utils::appDebugInfo()); + ui->debugInfoText->hide(); + ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); + + ui->version->setText("Version: "+QApplication::applicationVersion()); connect(ui->donate,&QPushButton::clicked,[=](){ @@ -46,3 +53,20 @@ About::~About() { delete ui; } + +void About::on_debugInfoButton_clicked() +{ + if(ui->debugInfoText->isVisible()){ + ui->debugInfoText->hide(); + ui->debugInfoButton->setText(QObject::tr("Show Debug Info")); + //update geometry after above loop is finished + QTimer::singleShot(300,this,[=]{ + this->resize(this->width(),this->minimumHeight()); + }); + }else{ + ui->debugInfoText->show(); + ui->debugInfoButton->setText(QObject::tr("Hide Debug Info")); + this->adjustSize(); + } + +} |