mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Setup DPI at startup
This commit is contained in:
parent
2ba3104337
commit
e4a5b8d352
1 changed files with 24 additions and 5 deletions
|
@ -40,6 +40,7 @@
|
|||
#include <QPen>
|
||||
#include <QPushButton>
|
||||
#include <QSplashScreen>
|
||||
|
||||
#ifdef QBT_STATIC_QT
|
||||
#include <QtPlugin>
|
||||
#ifdef QBT_USES_QT5
|
||||
|
@ -120,15 +121,20 @@ struct QBtCommandLineParameters
|
|||
}
|
||||
};
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
void showSplashScreen();
|
||||
#endif
|
||||
void displayVersion();
|
||||
void displayUsage(const QString &prg_name);
|
||||
bool userAgreesWithLegalNotice();
|
||||
void displayBadArgMessage(const QString &message);
|
||||
QBtCommandLineParameters parseCommandLine();
|
||||
|
||||
#if !defined(DISABLE_GUI)
|
||||
void showSplashScreen();
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
void setupDpi();
|
||||
#endif // Q_OS_UNIX
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
// Main
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -141,6 +147,11 @@ int main(int argc, char *argv[])
|
|||
macMigratePlists();
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_GUI) && defined(Q_OS_UNIX)
|
||||
setupDpi();
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
migrateRSS();
|
||||
#endif
|
||||
|
@ -379,7 +390,7 @@ void sigAbnormalHandler(int signum)
|
|||
}
|
||||
#endif // defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
#if !defined(DISABLE_GUI)
|
||||
void showSplashScreen()
|
||||
{
|
||||
QPixmap splash_img(":/icons/skin/splash.png");
|
||||
|
@ -393,7 +404,15 @@ void showSplashScreen()
|
|||
QTimer::singleShot(1500, splash, SLOT(deleteLater()));
|
||||
qApp->processEvents();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
void setupDpi()
|
||||
{
|
||||
if (qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR").isEmpty())
|
||||
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
||||
}
|
||||
#endif // Q_OS_UNIX
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
void displayVersion()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue