From 8e179dd659843d4e057e407bf951f55646a47593 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 26 Jan 2022 22:53:15 +0800 Subject: [PATCH] fix: shouldn't reset DPI when window is reshown --- RedPandaIDE/main.cpp | 2 ++ RedPandaIDE/mainwindow.cpp | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp index ad4b186b..c64e2b78 100644 --- a/RedPandaIDE/main.cpp +++ b/RedPandaIDE/main.cpp @@ -175,6 +175,8 @@ int main(int argc, char *argv[]) pMainWindow->newEditor(); } } + if (mainWindow.screen()) + setScreenDPI(mainWindow.screen()->logicalDotsPerInch()); mainWindow.show(); #ifdef Q_OS_WIN WindowLogoutEventFilter filter; diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index b297b2eb..eb3c8153 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -561,8 +561,6 @@ void MainWindow::updateEditorColorSchemes() void MainWindow::applySettings() { - qDebug()<<"--- apply settings -- "; - qDebug()<logicalDotsPerInch(); ThemeManager themeManager; PAppTheme appTheme = themeManager.theme(pSettings->environment().theme()); if (appTheme->isDark()) @@ -576,7 +574,6 @@ void MainWindow::applySettings() mFileInfoStatus->setPalette(appTheme->palette()); updateEditorColorSchemes(); - qDebug()<environment().interfaceFontSize()); QFont font(pSettings->environment().interfaceFont()); font.setPixelSize(pointToPixel(pSettings->environment().interfaceFontSize())); font.setStyleStrategy(QFont::PreferAntialias); @@ -626,7 +623,6 @@ void MainWindow::applySettings() updateEditorSettings(); updateDebuggerSettings(); updateActionIcons(); - qDebug()<<"*** app setting ****"; } void MainWindow::applyUISettings() @@ -698,7 +694,6 @@ void MainWindow::setActiveBreakpoint(QString FileName, int Line, bool setFocus) void MainWindow::updateDPI() { - qDebug()<<"dpi changed"; applySettings(); } @@ -3747,7 +3742,6 @@ void MainWindow::closeEvent(QCloseEvent *event) { void MainWindow::showEvent(QShowEvent *) { - setScreenDPI(screen()->logicalDotsPerInch()); applySettings(); const Settings::UI& settings = pSettings->ui(); ui->tabMessages->setCurrentIndex(settings.bottomPanelIndex());