Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make borders on windows 11 thinner #5836

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Bugfix: Fixed a crash that could occur on Linux and macOS when clicking "Install" from the update prompt. (#5818)
- Bugfix: Fixed missing word wrap in update popup. (#5811)
- Bugfix: Fixed tabs not scaling to the default scale when changing the scale from a non-default value. (#5794, #5833)
- Bugfix: Fixed a thick border on Windows 11. (#5836)
- Dev: Highlight checks now use non-capturing groups for the boundaries. (#5784)
- Dev: Updated Conan dependencies. (#5776)
- Dev: Support Boost 1.87. (#5832)
Expand Down
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, 0);
}
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
Loading