Redesign about dialog to match splash screen style
- 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>
This commit is contained in:
parent
50d90d4742
commit
079e790aae
@ -1,14 +1,96 @@
|
||||
#include "aboutdialog.h"
|
||||
#include "ui_aboutdialog.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDate>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
|
||||
AboutDialog::AboutDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::AboutDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
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);
|
||||
}
|
||||
|
||||
AboutDialog::~AboutDialog()
|
||||
void AboutDialog::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
delete ui;
|
||||
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);
|
||||
}
|
||||
|
||||
@ -2,10 +2,7 @@
|
||||
#define ABOUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AboutDialog;
|
||||
}
|
||||
#include <QColor>
|
||||
|
||||
class AboutDialog : public QDialog
|
||||
{
|
||||
@ -13,10 +10,19 @@ class AboutDialog : public QDialog
|
||||
|
||||
public:
|
||||
explicit AboutDialog(QWidget *parent = nullptr);
|
||||
~AboutDialog();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private:
|
||||
Ui::AboutDialog *ui;
|
||||
QColor mPrimaryColor;
|
||||
QColor mBgColor;
|
||||
QColor mTextColor;
|
||||
QColor mTextColorMuted;
|
||||
QColor mBorderColor;
|
||||
|
||||
static constexpr int WIDTH = 380;
|
||||
static constexpr int HEIGHT = 200;
|
||||
};
|
||||
|
||||
#endif // ABOUTDIALOG_H
|
||||
|
||||
@ -7,19 +7,19 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>200</height>
|
||||
<height>140</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>200</height>
|
||||
<height>140</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>200</height>
|
||||
<height>140</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -29,7 +29,7 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="labelIcon">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
@ -74,7 +74,7 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<widget class="QLabel" name="labelVersion">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@ -89,12 +89,12 @@
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XPlor v1.5</string>
|
||||
<string>XPlor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QLabel" name="labelCopyright">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@ -107,12 +107,12 @@
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Copyright © 2024 RedLine Solutions LLC</string>
|
||||
<string>Copyright</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<widget class="QLabel" name="labelWebsite">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@ -129,94 +129,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>With Help From:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>- Paging Red</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>- ISOCheated</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Roboto</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>- SureShotIan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user