From 428aec950e2607d4f032e9ace87ba54488651414 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 25 May 2025 02:04:01 -0700 Subject: [PATCH] widgets/wrapper: set WrapperRectangle border.width to 0 Works around the implicit 1px border applied to Rectangles when border is accessed, and works around QTBUG-137166. --- src/ui/ReloadPopup.qml | 1 + src/widgets/WrapperRectangle.qml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/ui/ReloadPopup.qml b/src/ui/ReloadPopup.qml index 81fa1ee2..5f2a9bd7 100644 --- a/src/ui/ReloadPopup.qml +++ b/src/ui/ReloadPopup.qml @@ -118,6 +118,7 @@ PanelWindow { anchors.fill: parent color: palette.active.window border.color: root.failed ? "#b53030" : palette.active.accent + border.width: 1 radius: 10 margin: 10 diff --git a/src/widgets/WrapperRectangle.qml b/src/widgets/WrapperRectangle.qml index 90c7b3a4..e769d686 100644 --- a/src/widgets/WrapperRectangle.qml +++ b/src/widgets/WrapperRectangle.qml @@ -58,6 +58,12 @@ Rectangle { /// See @@WrapperManager.child for details. property alias child: manager.child + // Reading the border property implicitly sets border width to 1. + // Setting it to 0 here means the user will also have to set border.width + // even if they just want 1, but it prevents adding unexpected padding + // and works around QTBUG-137166 otherwise. + border.width: 0 + MarginWrapperManager { id: manager extraMargin: (root.contentInsideBorder ? root.border.width : 0) + root.extraMargin