diff --git a/src/qt/qt_machinestatus.cpp b/src/qt/qt_machinestatus.cpp index cd9938cce..71be8c232 100644 --- a/src/qt/qt_machinestatus.cpp +++ b/src/qt/qt_machinestatus.cpp @@ -172,9 +172,6 @@ struct MachineStatus::States { Pixmaps pixmaps; States(QObject* parent) { -#ifdef _WIN32 - pixmap_size = QSize(16, 16) * qobject_cast(parent->parent())->screen()->devicePixelRatio(); -#endif pixmaps.cartridge.load("/cartridge%1.ico"); pixmaps.cassette.load("/cassette%1.ico"); pixmaps.floppy_disabled.normal = ProgSettings::loadIcon(QStringLiteral("/floppy_disabled.ico")).pixmap(pixmap_size); diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index b95d1e9e9..dc9935686 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -129,7 +129,11 @@ main_thread_fn() } int main(int argc, char* argv[]) { - QApplication app(argc, argv); + QApplication app(argc, argv); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + app.setAttribute(Qt::AA_UseHighDpiPixmaps); + app.setAttribute(Qt::AA_EnableHighDpiScaling); +#endif qt_set_sequence_auto_mnemonic(false); Q_INIT_RESOURCE(qt_resources); Q_INIT_RESOURCE(qt_translations); diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 9d4004102..4ed4ea1ab 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -418,7 +418,6 @@ MainWindow::MainWindow(QWidget *parent) : #ifdef _WIN32 ui->toolBar->setIconSize(QSize(16 * screen()->devicePixelRatio(), 16 * screen()->devicePixelRatio())); - ui->statusbar->resize(ui->statusbar->width(), ui->statusbar->sizeHint().height() * screen()->devicePixelRatio()); #endif } @@ -460,7 +459,7 @@ void MainWindow::showEvent(QShowEvent *event) { if (shownonce) return; shownonce = true; if (window_remember && !QApplication::platformName().contains("wayland")) { - setGeometry(window_x, window_y, window_w, window_h + menuBar()->height() + (hide_status_bar ? 0 : statusBar()->height())); + setGeometry(window_x, window_y, window_w, window_h + menuBar()->height() + (hide_status_bar ? 0 : statusBar()->height()) + (hide_tool_bar ? 0 : ui->toolBar->height())); } if (vid_resize == 2) { setFixedSize(fixed_size_x, fixed_size_y @@ -471,8 +470,11 @@ void MainWindow::showEvent(QShowEvent *event) { scrnsz_x = fixed_size_x; scrnsz_y = fixed_size_y; } - else if (window_remember) { - emit resizeContents(window_w, window_h); + else if (window_remember && vid_resize == 1) { + resize(window_w, window_h + + menuBar()->height() + + (hide_status_bar ? 0 : statusBar()->height()) + + (hide_tool_bar ? 0 : ui->toolBar->height()) + 1); scrnsz_x = window_w; scrnsz_y = window_h; }