qt: Fix hide toggles on resizable main window

This commit is contained in:
Cacodemon345
2022-07-30 14:38:02 +06:00
parent 0cc716bf6b
commit 94c84b299d

View File

@@ -1474,7 +1474,7 @@ void MainWindow::on_actionFullscreen_triggered() {
questionbox.exec();
config_save();
/* (re-capture mouse after dialog. */
/* (re-capture mouse after dialog). */
if (wasCaptured)
emit setMouseCapture(true);
}
@@ -1915,6 +1915,8 @@ void MainWindow::on_actionHiDPI_scaling_triggered()
void MainWindow::on_actionHide_status_bar_triggered()
{
auto w = ui->stackedWidget->width();
auto h = ui->stackedWidget->height();
hide_status_bar ^= 1;
ui->actionHide_status_bar->setChecked(hide_status_bar);
statusBar()->setVisible(!hide_status_bar);
@@ -1926,13 +1928,16 @@ void MainWindow::on_actionHide_status_bar_triggered()
} else {
int vid_resize_orig = vid_resize;
vid_resize = 0;
emit resizeContents(monitors[0].mon_scrnsz_x, monitors[0].mon_scrnsz_y);
emit resizeContents(w, h);
vid_resize = vid_resize_orig;
if (vid_resize == 1) setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
}
}
void MainWindow::on_actionHide_tool_bar_triggered()
{
auto w = ui->stackedWidget->width();
auto h = ui->stackedWidget->height();
hide_tool_bar ^= 1;
ui->actionHide_tool_bar->setChecked(hide_tool_bar);
ui->toolBar->setVisible(!hide_tool_bar);
@@ -1944,8 +1949,9 @@ void MainWindow::on_actionHide_tool_bar_triggered()
} else {
int vid_resize_orig = vid_resize;
vid_resize = 0;
emit resizeContents(monitors[0].mon_scrnsz_x, monitors[0].mon_scrnsz_y);
emit resizeContents(w, h);
vid_resize = vid_resize_orig;
if (vid_resize == 1) setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
}
}