19 #include <QGridLayout>
22 #include "aboutdialog.h"
25 AboutDialog::AboutDialog(QWidget* parent ) : QDialog(parent)
27 setWindowTitle(tr(
"About"));
28 setFixedSize(450,450);
31 void AboutDialog::init()
33 QVBoxLayout* lay =
new QVBoxLayout;
34 QPushButton *okButton =
new QPushButton(tr(
"OK"));
36 QHBoxLayout* buttonsLayout =
new QHBoxLayout;
38 devInfoText =
new QLabel(
this);
39 aboutText =
new QLabel(
this);
40 logo =
new QLabel(
this);
41 logoText =
new QLabel(
this);
43 logo->setPixmap(QPixmap(
":icons/logo.png"));
44 logo->setAlignment(Qt::AlignCenter);
45 logoText->setAlignment(Qt::AlignCenter);
47 logoText->setText(tr(
"<b>Pencil2D</b>"));
48 aboutText->setTextInteractionFlags(Qt::TextBrowserInteraction);
49 aboutText->setWordWrap(
true);
50 aboutText->setText(tr(
"Official site: <a href=\"http://pencil2d.org\">pencil2d.org</a>"
51 "<br>Developed by: <b>Pascal Naidon, Patrick Corrieri, Matt Chang, Cirus</b></>"
52 "<br>Thanks to: Qt Framework <a href=\"http://qt-project.org\">qt-project.org</a></>"
53 "<br>Distributed under the <a href=\"http://www.gnu.org/licenses/gpl-2.0.html\">GNU General Public License, version 2</a></>"));
55 connect(okButton, &QAbstractButton::clicked,
this, &QDialog::accept);
57 buttonsLayout->addWidget(okButton);
60 lay->addWidget(logoText);
61 lay->addWidget(aboutText);
63 #define STRINGIFY(x) #x
64 #define TOSTRING(x) STRINGIFY(x)
65 #define S__GIT_TIMESTAMP__ TOSTRING(GIT_TIMESTAMP)
66 #define S__GIT_COMMIT_HASH__ TOSTRING(GIT_CURRENT_SHA1)
69 devInfoText->setStyleSheet(
"QLabel { background-color: #ffffff;"
70 "border-style: solid; border-width: 1px; border-color: gray;}");
71 devInfoText->setTextInteractionFlags(Qt::TextSelectableByMouse);
72 devInfoText->setFixedHeight(60);
73 devInfoText->setAlignment(Qt::AlignCenter);
74 devInfoText->setText(tr(
"commit: " S__GIT_COMMIT_HASH__
"<br> date: " S__GIT_TIMESTAMP__)) ;
75 lay->addWidget(devInfoText);
79 lay->addLayout(buttonsLayout);