2
0
forked from Ivasoft/DSView

fix: When the display scale is 150%,window can't be maximized

This commit is contained in:
dreamsourcelabTAI
2022-06-02 17:56:28 +08:00
parent 8dc9c4a6d7
commit 14e1753879
3 changed files with 16 additions and 3 deletions

View File

@@ -206,7 +206,18 @@ void MainFrame::showNormal()
void MainFrame::showMaximized()
{
hide_border();
QFrame::showMaximized();
#ifdef _WIN32
double sk = QGuiApplication::primaryScreen()->devicePixelRatio();
if (sk >= 1.5)
{
auto rect = QGuiApplication::primaryScreen()->availableGeometry();
this->move(rect.left(), rect.top());
this->resize(rect.width(), rect.height());
}
#endif
QFrame::showMaximized();
}
void MainFrame::showMinimized()
@@ -426,6 +437,7 @@ void MainFrame::readSettings()
bool bReset = false;
//size from config is error
if (right == 0)
{
bReset = true;