mirror of
https://github.com/86Box/86Box.git
synced 2025-01-23 09:42:47 -05:00
Merge pull request #2080 from Cacodemon345/newqt
qt: Status bar and window fixes
This commit is contained in:
commit
216cf2a0d7
3 changed files with 11 additions and 8 deletions
|
@ -172,9 +172,6 @@ struct MachineStatus::States {
|
|||
Pixmaps pixmaps;
|
||||
|
||||
States(QObject* parent) {
|
||||
#ifdef _WIN32
|
||||
pixmap_size = QSize(16, 16) * qobject_cast<MainWindow*>(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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue