diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-03 19:52:50 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-04 12:53:55 +0200 |
| commit | ae84b9e45877783e98faa908414eaa9e63b5046f (patch) | |
| tree | 20e44f120ca2b9ff82159f42abbeffd464c7b594 | |
| parent | a4fa6f785ce6a382e34d224c54bd9072ebc0c929 (diff) | |
| download | qtmaildir-ae84b9e45877783e98faa908414eaa9e63b5046f.tar.gz qtmaildir-ae84b9e45877783e98faa908414eaa9e63b5046f.zip | |
feat(about): custom About dialog with icon, copyright and project link
Replace QMessageBox::about with a QDialog laid out in two columns: the
application icon on the left at 40%, the version, description, copyright
and AI-assistance notice on the right at 60%. A full-width row below both
carries the project URL.
The copyright line, GPLv2 notice and AI-assistance disclosure were absent
from the About window despite being present in the source headers and the
README.
| -rw-r--r-- | src/mainwindow.cpp | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1385f01..517941a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -27,6 +27,7 @@ #include <QFileInfo> #include <QHBoxLayout> #include <QHeaderView> +#include <QIcon> #include <QLabel> #include <QLineEdit> #include <QMenu> @@ -594,13 +595,51 @@ void MainWindow::showShortcutReference() void MainWindow::showAbout() { - QMessageBox::about( - this, tr("About qtmaildir"), - tr("<h3>qtmaildir %1</h3>" - "<p>A Qt6 mail client for notmuch-indexed Maildirs.</p>" - "<p>Reads and organizes local mail. Fetching and sending are " - "handled by external scripts.</p>") - .arg(QStringLiteral(QTMAILDIR_VERSION))); + QDialog dialog(this); + dialog.setWindowTitle(tr("About qtmaildir")); + + auto *icon = new QLabel(&dialog); + icon->setPixmap(QIcon(QStringLiteral(":/icons/qtmaildir.svg")) + .pixmap(QSize(160, 160))); + icon->setAlignment(Qt::AlignCenter); + + auto *text = new QLabel(&dialog); + text->setTextFormat(Qt::RichText); + text->setWordWrap(true); + text->setAlignment(Qt::AlignTop); + text->setText(tr("<h3>qtmaildir %1</h3>" + "<p>A Qt6 mail client for notmuch-indexed Maildirs.</p>" + "<p>Reads and organizes local mail. Fetching and sending " + "are handled by external scripts.</p>" + "<p>Copyright © 2026 Danilo M. " + "<danix@danix.xyz><br>" + "Licensed under the GNU General Public License " + "version 2.</p>" + "<p>Developed with AI assistance. All code is reviewed, " + "tested and curated by the maintainer.</p>") + .arg(QStringLiteral(QTMAILDIR_VERSION))); + + auto *link = new QLabel( + QStringLiteral("<a href='https://danix.xyz/qtmaildir'>" + "https://danix.xyz/qtmaildir</a>"), + &dialog); + link->setTextFormat(Qt::RichText); + link->setAlignment(Qt::AlignCenter); + link->setOpenExternalLinks(true); + + auto *buttons = new QDialogButtonBox(QDialogButtonBox::Ok, &dialog); + connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); + + auto *columns = new QHBoxLayout; + columns->addWidget(icon, 40); + columns->addWidget(text, 60); + + auto *layout = new QVBoxLayout(&dialog); + layout->addLayout(columns); + layout->addWidget(link); + layout->addWidget(buttons); + + dialog.exec(); } void MainWindow::wireWorker() |
