This repository has been archived by the owner on Apr 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
73 lines (62 loc) · 2.59 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <QtGlobal>
#if defined(_WIN32) && !defined(_DLL)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Static linking on Windows
#include <QtPlugin>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
#endif
#endif
#include <QApplication>
#include <QStyleFactory>
#include "MainWindow.hpp"
#include "Common.hpp"
extern "C" const uint8_t MAINICON_QT[];
static QIcon MakeAppIcon() {
QIcon ret;
const uint8_t* ptr = MAINICON_QT;
for (int i = 0; i < 6; ++i) {
uint32_t size = *reinterpret_cast<const uint32_t*>(ptr);
ptr += 4;
QPixmap pm;
pm.loadFromData(ptr, size);
ret.addPixmap(pm);
ptr += size;
}
return ret;
}
int main(int argc, char* argv[]) {
InitializePlatform();
QApplication::setOrganizationName(QStringLiteral("AxioDL"));
QApplication::setApplicationName(QStringLiteral("HECL"));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication::setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
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));
QApplication::setPalette(darkPalette);
MainWindow w;
w.show();
return QApplication::exec();
}