2017-12-25 21:53:37 +00:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QStyleFactory>
|
2017-12-06 04:49:56 +00:00
|
|
|
#include "MainWindow.hpp"
|
2017-12-27 00:48:34 +00:00
|
|
|
#include "Common.hpp"
|
2017-12-06 04:49:56 +00:00
|
|
|
|
2017-12-27 04:10:44 +00:00
|
|
|
extern "C" const uint8_t MAINICON_QT[];
|
2017-12-25 21:53:37 +00:00
|
|
|
|
2018-12-08 05:19:40 +00:00
|
|
|
static QIcon MakeAppIcon() {
|
|
|
|
QIcon ret;
|
2017-12-25 21:53:37 +00:00
|
|
|
|
2018-12-08 05:19:40 +00:00
|
|
|
const uint8_t* ptr = MAINICON_QT;
|
|
|
|
for (int i = 0; i < 6; ++i) {
|
|
|
|
uint32_t size = *reinterpret_cast<const uint32_t*>(ptr);
|
|
|
|
ptr += 4;
|
2017-12-25 21:53:37 +00:00
|
|
|
|
2018-12-08 05:19:40 +00:00
|
|
|
QPixmap pm;
|
|
|
|
pm.loadFromData(ptr, size);
|
|
|
|
ret.addPixmap(pm);
|
|
|
|
ptr += size;
|
|
|
|
}
|
2017-12-25 21:53:37 +00:00
|
|
|
|
2018-12-08 05:19:40 +00:00
|
|
|
return ret;
|
2017-12-25 21:53:37 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:19:40 +00:00
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
InitializePlatform();
|
2017-12-27 00:48:34 +00:00
|
|
|
|
2019-08-28 01:35:51 +00:00
|
|
|
QApplication::setOrganizationName(QStringLiteral("AxioDL"));
|
|
|
|
QApplication::setApplicationName(QStringLiteral("HECL"));
|
2019-01-26 23:22:16 +00:00
|
|
|
|
2017-12-25 21:53:37 +00:00
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
2018-12-08 05:19:40 +00:00
|
|
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
2017-12-25 21:53:37 +00:00
|
|
|
#endif
|
2019-08-28 01:35:51 +00:00
|
|
|
QApplication::setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
|
2018-12-08 05:19:40 +00:00
|
|
|
QApplication a(argc, argv);
|
|
|
|
QApplication::setWindowIcon(MakeAppIcon());
|
|
|
|
|
|
|
|
QPalette darkPalette;
|
|
|
|
darkPalette.setColor(QPalette::Window, QColor(53, 53, 53));
|
|
|
|
darkPalette.setColor(QPalette::WindowText, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Base, QColor(42, 42, 42));
|
|
|
|
darkPalette.setColor(QPalette::Disabled, QPalette::Base, QColor(25, 25, 25, 53));
|
|
|
|
darkPalette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
|
|
|
|
darkPalette.setColor(QPalette::ToolTipBase, QColor(42, 42, 42));
|
|
|
|
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Text, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Disabled, QPalette::Text, QColor(255, 255, 255, 120));
|
|
|
|
darkPalette.setColor(QPalette::Button, QColor(53, 53, 53));
|
|
|
|
darkPalette.setColor(QPalette::Disabled, QPalette::Button, QColor(53, 53, 53, 53));
|
|
|
|
darkPalette.setColor(QPalette::ButtonText, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(255, 255, 255, 120));
|
|
|
|
darkPalette.setColor(QPalette::BrightText, Qt::red);
|
|
|
|
darkPalette.setColor(QPalette::Link, QColor(42, 130, 218));
|
|
|
|
darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
|
|
|
|
darkPalette.setColor(QPalette::Disabled, QPalette::Highlight, QColor(42, 130, 218, 53));
|
|
|
|
darkPalette.setColor(QPalette::HighlightedText, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Disabled, QPalette::HighlightedText, QColor(255, 255, 255, 120));
|
|
|
|
a.setPalette(darkPalette);
|
|
|
|
|
|
|
|
MainWindow w;
|
|
|
|
w.show();
|
|
|
|
return a.exec();
|
2017-12-06 04:49:56 +00:00
|
|
|
}
|