mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -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 <QPen>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QSplashScreen>
|
#include <QSplashScreen>
|
||||||
|
|
||||||
#ifdef QBT_STATIC_QT
|
#ifdef QBT_STATIC_QT
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#ifdef QBT_USES_QT5
|
#ifdef QBT_USES_QT5
|
||||||
|
@ -120,15 +121,20 @@ struct QBtCommandLineParameters
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
|
||||||
void showSplashScreen();
|
|
||||||
#endif
|
|
||||||
void displayVersion();
|
void displayVersion();
|
||||||
void displayUsage(const QString &prg_name);
|
void displayUsage(const QString &prg_name);
|
||||||
bool userAgreesWithLegalNotice();
|
bool userAgreesWithLegalNotice();
|
||||||
void displayBadArgMessage(const QString &message);
|
void displayBadArgMessage(const QString &message);
|
||||||
QBtCommandLineParameters parseCommandLine();
|
QBtCommandLineParameters parseCommandLine();
|
||||||
|
|
||||||
|
#if !defined(DISABLE_GUI)
|
||||||
|
void showSplashScreen();
|
||||||
|
|
||||||
|
#if defined(Q_OS_UNIX)
|
||||||
|
void setupDpi();
|
||||||
|
#endif // Q_OS_UNIX
|
||||||
|
#endif // DISABLE_GUI
|
||||||
|
|
||||||
// Main
|
// Main
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -141,6 +147,11 @@ int main(int argc, char *argv[])
|
||||||
macMigratePlists();
|
macMigratePlists();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(DISABLE_GUI) && defined(Q_OS_UNIX)
|
||||||
|
setupDpi();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
migrateRSS();
|
migrateRSS();
|
||||||
#endif
|
#endif
|
||||||
|
@ -379,7 +390,7 @@ void sigAbnormalHandler(int signum)
|
||||||
}
|
}
|
||||||
#endif // defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
#endif // defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
#if !defined(DISABLE_GUI)
|
||||||
void showSplashScreen()
|
void showSplashScreen()
|
||||||
{
|
{
|
||||||
QPixmap splash_img(":/icons/skin/splash.png");
|
QPixmap splash_img(":/icons/skin/splash.png");
|
||||||
|
@ -393,7 +404,15 @@ void showSplashScreen()
|
||||||
QTimer::singleShot(1500, splash, SLOT(deleteLater()));
|
QTimer::singleShot(1500, splash, SLOT(deleteLater()));
|
||||||
qApp->processEvents();
|
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()
|
void displayVersion()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue