From 227d7871c08e56c690afaec8ac7fcbde1a180cb0 Mon Sep 17 00:00:00 2001 From: Dax Date: Sun, 14 Feb 2021 18:46:20 +0100 Subject: [PATCH] Redesigned AboutBox --- LibREDasm | 2 +- artwork/logo_20190204.png | Bin 6211 -> 0 bytes dialogs/aboutdialog/aboutdialog.cpp | 40 ++- dialogs/aboutdialog/aboutdialog.h | 1 + dialogs/aboutdialog/aboutdialog.ui | 388 ++++++++++++++++++++++------ redasmsettings.cpp | 2 +- 6 files changed, 347 insertions(+), 86 deletions(-) delete mode 100644 artwork/logo_20190204.png diff --git a/LibREDasm b/LibREDasm index 70692184..5c120b39 160000 --- a/LibREDasm +++ b/LibREDasm @@ -1 +1 @@ -Subproject commit 70692184aeb581f8b3b9fc4464e13143b6505e20 +Subproject commit 5c120b395f0811c566535ed40a88a96ae074eabf diff --git a/artwork/logo_20190204.png b/artwork/logo_20190204.png deleted file mode 100644 index 69d3cc68be1246388c60bd328d03306eb55673e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6211 zcmZ{oc|26#|Hsb^gA9WVCVNw<5JR$L*Gwr(iJ}_o6k}f|TgbFA){<o`$L$25BU0cZ4Z7YIV1AAQ0RQc+A1pjTRtaj{ahc$7+1B6v za;R(2B@h}Ks^;nEO(D4kTvGE7^2nYwkOn}CejIOV7xsYtHR>|)QV#zdhhsfTKAvy# z9@~aaw9*V!Lb#hY@59@Ck&q1BLtE-_ou|TIC$waA{VAZvra6uxY(k|ZYpFd=d9yDN z_zS9f6EAIs8u&Qp_X5`7WN$-3ylcb6- zVuSVn)<~5aK22K{{7o>BB-$opm2=e?LQu3g8+4XVR>z|X`4zmjVSs& zL1A1_@$TWnhrP7@M_WE%C?y(GCV(Gq4$CZ*tvJ8V;I50naL{l+1Qp?$S(fa2-;s2^ z^HD#xd5yGO9Z;WT+o~3>#F=3ZJQ^ zkX>O8wHIIAjhddGw$^0Gij3n(iG?})r#9?tZ7Gc*0#>TjKa|s@AND3{JO;W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_U|ggK&?={%OiaD&{ij(v&jE13DKvN9%M}QWrt=%L;dfghO-H4eDN*0 Ud~b*$RPYDK3D)>ZGnecC2di(3lmGw# diff --git a/dialogs/aboutdialog/aboutdialog.cpp b/dialogs/aboutdialog/aboutdialog.cpp index 1779adf7..44d07f09 100644 --- a/dialogs/aboutdialog/aboutdialog.cpp +++ b/dialogs/aboutdialog/aboutdialog.cpp @@ -1,21 +1,28 @@ #include "aboutdialog.h" #include "ui_aboutdialog.h" +#include "../../redasmsettings.h" #include "../../themeprovider.h" +#include #include #include #include +#include AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDialog) { ui->setupUi(this); - ui->lblHeader->setText(QString(ui->lblHeader->text()).arg(REDASM_VERSION, QT_VERSION_STR)); + ui->lblVersion->setText(REDASM_VERSION); + ui->lblQtVersion->setText(QT_VERSION_STR); + ui->lblLibREDasmVersion->setText(LIBREDASM_VERSION); + ui->lblRDApiLevel->setText(QString::number(RDAPI_LEVEL)); - this->setStyleSheet("QTextEdit {" - "background: transparent;" - "border: 0;" - "}"); + ui->tbDependencies->setStyleSheet("QTextEdit {" + "background: transparent;" + "border: 0;" + "}"); this->initDependencies(); + this->initSearchPaths(); if(ThemeProvider::isDarkTheme()) ui->lblLogo->setPixmap(QPixmap(":/res/logo_dark.png")); else ui->lblLogo->setPixmap(QPixmap(":/res/logo.png")); @@ -34,11 +41,30 @@ void AboutDialog::initDependencies() }; QTextCursor cursor(ui->tbDependencies->document()); - cursor.insertHtml("Thanks to:
"); + QTextListFormat lf; + lf.setStyle(QTextListFormat::ListDisc); + cursor.insertList(lf); for(const auto& [name, url] : DEPENDENCIES) { - cursor.insertHtml(QString("- %2").arg(url, name)); + QTextCharFormat cf; + cf.setAnchor(true); + cf.setAnchorHref(url); + cf.setForeground(qApp->palette().brush(QPalette::Highlight)); + cursor.insertText(" " + name, cf); if(name != DEPENDENCIES.back().first) cursor.insertText("\n"); } } + +void AboutDialog::initSearchPaths() +{ + RDConfig_GetPluginPaths([](const char* path, void* userdata) { + auto* thethis = reinterpret_cast(userdata); + thethis->addItem(path); + }, ui->lwPluginPaths); + + RDConfig_GetDatabasePaths([](const char* path, void* userdata) { + auto* thethis = reinterpret_cast(userdata); + thethis->addItem(path); + }, ui->lwDatabasePaths); +} diff --git a/dialogs/aboutdialog/aboutdialog.h b/dialogs/aboutdialog/aboutdialog.h index ef3adb43..dd282258 100644 --- a/dialogs/aboutdialog/aboutdialog.h +++ b/dialogs/aboutdialog/aboutdialog.h @@ -16,6 +16,7 @@ class AboutDialog : public QDialog private: void initDependencies(); + void initSearchPaths(); private: Ui::AboutDialog *ui; diff --git a/dialogs/aboutdialog/aboutdialog.ui b/dialogs/aboutdialog/aboutdialog.ui index 27aced1b..843cf530 100644 --- a/dialogs/aboutdialog/aboutdialog.ui +++ b/dialogs/aboutdialog/aboutdialog.ui @@ -9,8 +9,8 @@ 0 0 - 682 - 323 + 800 + 500 @@ -21,8 +21,14 @@ - 0 - 0 + 800 + 500 + + + + + 800 + 500 @@ -31,109 +37,337 @@ true - - - 14 - - - 14 - - - 14 - - - 14 - + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + 256 + 256 + + + + + 256 + 256 + + + + + 0 + 0 + + + + + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + - - - 16 - + - + + + 0 + + + 6 + + + 12 + - - - - 0 - 0 - - - - - 256 - 256 - - - - - 256 - 256 - - - - - 0 - 0 - + + + + Monospace + 24 + 75 + true + - + <html><head/><body><p><span style=" color:#c03131;">REDasm</span></p></body></html> - Qt::AlignCenter + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - Qt::Vertical + + + + Monospace + 14 + - - - 20 - 40 - + + <html><head/><body><p><span style=" color:#2b2b2b;">The OpenSource Disassembler</span></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - + - - - + + + 8 + + + + + + 75 + true + + - <html><head/><body><p align="center"><span style=" font-size:18pt; font-weight:600;">REDasm: The OpenSource Disassembler</span></p><p><span style=" font-size:12pt; font-weight:600;">Version</span><span style=" font-size:12pt;">: %1<br/></span><span style=" font-size:12pt; font-weight:600;">Qt Version</span><span style=" font-size:12pt;">: %2</span></p></body></html> + Version: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - false + + + + <version> - - QTextEdit::NoWrap + + + + + + + 75 + true + - - true + + LibREDasm Version: - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - true + + + + + + <libredasmversion> + + + + + + + + 75 + true + + + + QtVersion: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + <qtversion> + + + + + + + + 75 + true + + + + RDAPI Level: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + <rdapilevel> - - - - + + + + QTabWidget::South + + + 0 + + + + Thanks To + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + false + + + QTextEdit::NoWrap + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse + + + true + + + + + + + + Plugin Paths + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + true + + + + + + + + Database Paths + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + true + + + + + + + diff --git a/redasmsettings.cpp b/redasmsettings.cpp index 89c0d881..480e1664 100644 --- a/redasmsettings.cpp +++ b/redasmsettings.cpp @@ -71,7 +71,7 @@ QFont REDasmSettings::font() REDasmSettings settings; QFont f = settings.currentFont(); - if(!(f.styleHint() & QFont::Monospace)) + if(f.styleHint() == QFont::Monospace) { f.setFamily("Monospace"); // Force Monospaced font f.setStyleHint(QFont::TypeWriter);