- fix: macos icon size overgrown (#106)

MacOS uses high DPI pixmaps with devicePixelRatio equals 2. Setting a
flag in QApplication can enforce this in pixmaps fetched from QIcons and
thus make the icons look high DPI.
This commit is contained in:
Wu Haotian 2023-03-11 07:49:47 +08:00 committed by GitHub
parent fdc04c0d4f
commit da23ae64ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -252,6 +252,10 @@ int main(int argc, char *argv[])
// qputenv("QT_AUTO_SCREEN_SCALE_FACTOR","false");
//#endif
QApplication app(argc, argv);
#ifdef Q_OS_MACOS
// Fix macOS overgrown icon size issue
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QFile tempFile(QDir::tempPath()+QDir::separator()+"RedPandaDevCppStartUp.lock");
{
bool firstRun;