About dialog

This commit is contained in:
Dan Paulat 2023-01-08 00:48:47 -06:00
parent aaeea156f3
commit 5c793e07d8
10 changed files with 294 additions and 7 deletions

View file

@ -0,0 +1,43 @@
#include "about_dialog.hpp"
#include "ui_about_dialog.h"
#include <scwx/qt/manager/resource_manager.hpp>
#include <QFontDatabase>
namespace scwx
{
namespace qt
{
namespace ui
{
class AboutDialogImpl
{
public:
explicit AboutDialogImpl() = default;
~AboutDialogImpl() = default;
};
AboutDialog::AboutDialog(QWidget* parent) :
QDialog(parent),
p {std::make_unique<AboutDialogImpl>()},
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
int titleFontId =
manager::ResourceManager::FontId(types::Font::din1451alt_g);
QString titleFontFamily =
QFontDatabase::applicationFontFamilies(titleFontId).at(0);
QFont titleFont(titleFontFamily, 14);
ui->titleLabel->setFont(titleFont);
}
AboutDialog::~AboutDialog()
{
delete ui;
}
} // namespace ui
} // namespace qt
} // namespace scwx

View file

@ -0,0 +1,38 @@
#pragma once
#include <QDialog>
namespace Ui
{
class AboutDialog;
}
namespace scwx
{
namespace qt
{
namespace ui
{
class AboutDialogImpl;
class AboutDialog : public QDialog
{
Q_OBJECT
private:
Q_DISABLE_COPY(AboutDialog)
public:
explicit AboutDialog(QWidget* parent = nullptr);
~AboutDialog();
private:
friend AboutDialogImpl;
std::unique_ptr<AboutDialogImpl> p;
Ui::AboutDialog* ui;
};
} // namespace ui
} // namespace qt
} // namespace scwx

View file

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>276</width>
<height>404</height>
</rect>
</property>
<property name="windowTitle">
<string>About Supercell Wx</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../scwx-qt.qrc">:/res/icons/scwx-256.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>Supercell Wx</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="versionLabel">
<property name="text">
<string>Version X.Y.Z</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="revisionLabel">
<property name="text">
<string>Git Revision 0000000000</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="copyrightLabel">
<property name="text">
<string>Copyright © 2021-YYYY Dan Paulat</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../../../../scwx-qt.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>AboutDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>AboutDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>