mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Support for high DPI screens
This commit is contained in:
@@ -152,6 +152,11 @@ namespace BlackGui
|
||||
CApplication::exit(retcode);
|
||||
}
|
||||
|
||||
void CGuiApplication::highDpiScreenSupport()
|
||||
{
|
||||
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
||||
}
|
||||
|
||||
void CGuiApplication::ps_startupCompleted()
|
||||
{
|
||||
CApplication::ps_startupCompleted();
|
||||
|
||||
@@ -136,6 +136,10 @@ namespace BlackGui
|
||||
//! Exit application, perform graceful shutdown and exit
|
||||
static void exit(int retcode = 0);
|
||||
|
||||
//! Support for high DPI screens
|
||||
//! \note Needs to be at the beginning of main
|
||||
static void highDpiScreenSupport();
|
||||
|
||||
signals:
|
||||
//! Style sheet changed
|
||||
void styleSheetsChanged();
|
||||
|
||||
@@ -27,6 +27,7 @@ using namespace BlackGui;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//! [CSwiftGuiStdApplication]
|
||||
CGuiApplication::highDpiScreenSupport();
|
||||
QApplication qa(argc, argv);
|
||||
CGuiApplication a("swift core", CIcons::swiftNova24());
|
||||
a.addWindowStateOption();
|
||||
|
||||
@@ -27,6 +27,7 @@ using namespace BlackGui;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
CGuiApplication::highDpiScreenSupport();
|
||||
QApplication qa(argc, argv);
|
||||
Q_UNUSED(qa);
|
||||
CGuiApplication a("swift mapping tool", CIcons::swiftDatabase48());
|
||||
|
||||
@@ -28,6 +28,7 @@ using namespace BlackCore;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//! [CSwiftGuiStdApplication]
|
||||
CGuiApplication::highDpiScreenSupport();
|
||||
QApplication qa(argc, argv);
|
||||
CGuiApplication a("swift launcher", CIcons::swift1024());
|
||||
a.addParserOption({{"i", "installer"}, QCoreApplication::translate("main", "Installer setup."), "installer"});
|
||||
|
||||
Reference in New Issue
Block a user