- Custom painting with theme colors - Accent stripe at top - "X" in accent color, "Plor" in text color - Dynamic version from QCoreApplication - Dynamic copyright year - Removed "With Help From" section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
97 lines
2.9 KiB
C++
97 lines
2.9 KiB
C++
#include "aboutdialog.h"
|
|
#include "settings.h"
|
|
|
|
#include <QCoreApplication>
|
|
#include <QDate>
|
|
#include <QPainter>
|
|
#include <QPainterPath>
|
|
|
|
AboutDialog::AboutDialog(QWidget *parent)
|
|
: QDialog(parent)
|
|
{
|
|
setWindowTitle(tr("About XPlor"));
|
|
setFixedSize(WIDTH, HEIGHT);
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
|
|
// Load theme colors
|
|
Theme theme = Settings::instance().theme();
|
|
mPrimaryColor = QColor(theme.accentColor);
|
|
mBgColor = QColor(theme.backgroundColor);
|
|
mTextColor = QColor(theme.textColor);
|
|
mTextColorMuted = QColor(theme.textColorMuted);
|
|
mBorderColor = QColor(theme.borderColor);
|
|
}
|
|
|
|
void AboutDialog::paintEvent(QPaintEvent *event)
|
|
{
|
|
Q_UNUSED(event);
|
|
|
|
QPainter painter(this);
|
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
|
painter.setRenderHint(QPainter::TextAntialiasing, true);
|
|
|
|
// Draw background
|
|
painter.setPen(Qt::NoPen);
|
|
painter.setBrush(mBgColor);
|
|
painter.drawRect(rect());
|
|
|
|
// Draw accent stripe at top
|
|
painter.setBrush(mPrimaryColor);
|
|
painter.drawRect(0, 0, WIDTH, 6);
|
|
|
|
// Draw app icon
|
|
QPixmap icon(":/images/data/images/XPlor.png");
|
|
if (!icon.isNull()) {
|
|
QRect iconRect(30, 40, 64, 64);
|
|
painter.drawPixmap(iconRect, icon.scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
|
}
|
|
|
|
// Draw "XPlor" title
|
|
int textX = 115;
|
|
int titleY = 60;
|
|
|
|
QFont titleFont("Segoe UI", 28, QFont::Bold);
|
|
painter.setFont(titleFont);
|
|
QFontMetrics titleMetrics(titleFont);
|
|
|
|
// Draw "X" in accent color
|
|
painter.setPen(mPrimaryColor);
|
|
painter.drawText(textX, titleY, "X");
|
|
|
|
// Draw "Plor" in text color
|
|
painter.setPen(mTextColor);
|
|
int xWidth = titleMetrics.horizontalAdvance("X");
|
|
painter.drawText(textX + xWidth, titleY, "Plor");
|
|
|
|
// Version
|
|
QFont versionFont("Segoe UI", 11);
|
|
painter.setFont(versionFont);
|
|
painter.setPen(mTextColorMuted);
|
|
QString version = QString("Version %1").arg(QCoreApplication::applicationVersion());
|
|
painter.drawText(textX, titleY + 25, version);
|
|
|
|
// Tagline
|
|
QFont taglineFont("Segoe UI", 10);
|
|
painter.setFont(taglineFont);
|
|
painter.setPen(mTextColorMuted);
|
|
painter.drawText(textX, titleY + 50, "Binary File Format Explorer");
|
|
|
|
// Copyright
|
|
QFont copyrightFont("Segoe UI", 9);
|
|
painter.setFont(copyrightFont);
|
|
painter.setPen(mTextColorMuted);
|
|
|
|
QString copyright = QString("Copyright %1 %2 RedLine Solutions LLC")
|
|
.arg(QChar(0x00A9))
|
|
.arg(QDate::currentDate().year());
|
|
painter.drawText(30, HEIGHT - 45, copyright);
|
|
|
|
// Website
|
|
painter.drawText(30, HEIGHT - 25, "redline.llc");
|
|
|
|
// Draw subtle border
|
|
painter.setPen(QPen(mBorderColor, 1));
|
|
painter.setBrush(Qt::NoBrush);
|
|
painter.drawRect(0, 0, WIDTH - 1, HEIGHT - 1);
|
|
}
|