From 4354c87bf4a0cb896330e44625ae1a75513e7b1c Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sun, 19 Jan 2025 11:29:27 +0100 Subject: [PATCH 1/3] fix: make borders on windows 11 thinner --- src/widgets/BaseWindow.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index 31f72a3df61..2b280b6a2c7 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -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 @@ -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 From 53ca427646ace6208913425ee2411b4c6be08769 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sun, 19 Jan 2025 11:46:58 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89036d70d8c..0426f89d6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) From a133a400eab511b0136cd4df122ae3c8fff42ee9 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Sun, 19 Jan 2025 12:04:09 +0100 Subject: [PATCH 3/3] fix: no bottom margins --- src/widgets/BaseWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index 2b280b6a2c7..d05fee25bee 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -351,7 +351,7 @@ void BaseWindow::init() this->ui_.layoutBase = new BaseWidget(this); if (isWindows11OrGreater()) { - this->ui_.layoutBase->setContentsMargins(0, 0, 0, 1); + this->ui_.layoutBase->setContentsMargins(0, 0, 0, 0); } else {