fix: make borders on windows 11 thinner (#5836)

This commit is contained in:
nerix
2025-03-08 15:44:57 +01:00
committed by GitHub
parent ee266c35a7
commit 8670de8989
2 changed files with 20 additions and 3 deletions
+19 -3
View File
@@ -365,7 +365,14 @@ void BaseWindow::init()
}
this->ui_.layoutBase = new BaseWidget(this);
this->ui_.layoutBase->setContentsMargins(1, 0, 1, 1);
if (isWindows11OrGreater())
{
this->ui_.layoutBase->setContentsMargins(0, 0, 0, 0);
}
else
{
this->ui_.layoutBase->setContentsMargins(1, 0, 1, 1);
}
layout->addWidget(this->ui_.layoutBase);
}
#endif
@@ -1069,8 +1076,17 @@ void BaseWindow::drawCustomWindowFrame(QPainter &painter)
{
painter.setTransform(QTransform::fromScale(1 / dpr, 1 / dpr));
}
painter.fillRect(1, 1, this->realBounds_.width() - 2,
this->realBounds_.height() - 2, bg);
if (isWindows11OrGreater())
{
painter.fillRect(0, 0, this->realBounds_.width() - 1,
this->realBounds_.height() - 1, bg);
}
else
{
painter.fillRect(1, 1, this->realBounds_.width() - 2,
this->realBounds_.height() - 2, bg);
}
}
}
#endif