lightpreview: enable highdpi support, set larger default window size

This commit is contained in:
Eric Wasylishen 2023-10-01 18:47:33 -06:00
parent a287eb0c22
commit 7abfec9dc2
2 changed files with 10 additions and 2 deletions

View File

@ -22,6 +22,8 @@ See file, 'COPYING', for details.
#include <QSurfaceFormat> #include <QSurfaceFormat>
#include <QSettings> #include <QSettings>
#include <QCoreApplication> #include <QCoreApplication>
#include <QGuiApplication>
#include <QtGlobal>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
@ -30,6 +32,12 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationName("ericw-tools"); QCoreApplication::setOrganizationName("ericw-tools");
QCoreApplication::setApplicationName("lightpreview"); QCoreApplication::setApplicationName("lightpreview");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
// allow non-integer monitor scaling
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
QApplication a(argc, argv); QApplication a(argc, argv);
a.setStyle("fusion"); a.setStyle("fusion");
a.setPalette(QPalette(QColor(64, 64, 64))); a.setPalette(QPalette(QColor(64, 64, 64)));

View File

@ -124,8 +124,6 @@ MainWindow::MainWindow(QWidget *parent)
// create the menu first as it is used by other things (dock widgets) // create the menu first as it is used by other things (dock widgets)
setupMenu(); setupMenu();
resize(640, 480);
// gl view // gl view
glView = new GLView(this); glView = new GLView(this);
setCentralWidget(glView); setCentralWidget(glView);
@ -136,6 +134,8 @@ MainWindow::MainWindow(QWidget *parent)
createOutputLog(); createOutputLog();
createStatusBar(); createStatusBar();
resize(1024, 768);
} }
void MainWindow::createPropertiesSidebar() void MainWindow::createPropertiesSidebar()