qt: Round resize width and height

This commit is contained in:
Cacodemon345
2022-02-10 22:32:17 +06:00
committed by GitHub
parent c44dd4bb9a
commit f75c1b8a00

View File

@@ -187,9 +187,9 @@ MainWindow::MainWindow(QWidget *parent) :
connect(this, &MainWindow::resizeContents, this, [this](int w, int h) {
if (!QApplication::platformName().contains("eglfs") && vid_resize == 0) {
w = w / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1);
w = qRound(w / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.));
int modifiedHeight = (h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1))
int modifiedHeight = qRound(h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.))
+ menuBar()->height()
+ (statusBar()->height() * !hide_status_bar)
+ (ui->toolBar->height() * !hide_tool_bar);