diff --git a/gta5sync.pro b/gta5sync.pro index 2ba73fd..abd26ba 100755 --- a/gta5sync.pro +++ b/gta5sync.pro @@ -103,7 +103,11 @@ DISTFILES += res/app.rc \ INCLUDEPATH += ./uimod +# WINDOWS ONLY + +win32: DEFINES += GTA5SYNC_WIN win32: RC_FILE += res/app.rc +win32: LIBS += -luser32 # QT4 ONLY STUFF diff --git a/main.cpp b/main.cpp index c52626b..1ab6388 100755 --- a/main.cpp +++ b/main.cpp @@ -28,19 +28,42 @@ #include #include #include +#include #include +#include #include #include #include +#include #include #include +#ifdef GTA5SYNC_WIN +#include "windows.h" +#include +#endif + int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setApplicationName("gta5sync"); a.setApplicationVersion("1.0.0"); +#ifdef GTA5SYNC_WIN + // Get Windows Font + NONCLIENTMETRICS ncm; + ncm.cbSize = sizeof(ncm); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); + LOGFONTW uiFont = ncm.lfMessageFont; + char faceName[32]; + char DefChar = ' '; + WideCharToMultiByte(CP_ACP, 0, uiFont.lfFaceName, -1, faceName, 32, &DefChar, NULL); + std::string uiFontStr(faceName); + + QFont appFont(QString::fromStdString(uiFontStr), 9); + a.setFont(appFont); +#endif + QDir appDir = QFileInfo(a.applicationFilePath()).absoluteDir(); if (appDir.cd("plugins")) {