Skip to content

Commit

Permalink
fix: make borders on windows 11 thinner
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Jan 19, 2025
1 parent e92067b commit 4354c87
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/widgets/BaseWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,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, 1);
}
else
{
this->ui_.layoutBase->setContentsMargins(1, 0, 1, 1);
}
layout->addWidget(this->ui_.layoutBase);
}
#endif
Expand Down Expand Up @@ -1049,8 +1056,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
Expand Down

0 comments on commit 4354c87

Please sign in to comment.