From 10cb6a248c662363d1953244ec0a5697407066a8 Mon Sep 17 00:00:00 2001 From: Mentalflow <312902918@qq.com> Date: Sun, 11 Aug 2024 18:09:42 +0800 Subject: [PATCH] RibbonRectangle: Add antialiasing and widen the border as default Rectangle's border. --- lib_source/qml/Qt5/RibbonRectangle.qml | 6 +++++- lib_source/qml/Qt6/RibbonRectangle.qml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib_source/qml/Qt5/RibbonRectangle.qml b/lib_source/qml/Qt5/RibbonRectangle.qml index 9c5af78..91ec71f 100644 --- a/lib_source/qml/Qt5/RibbonRectangle.qml +++ b/lib_source/qml/Qt5/RibbonRectangle.qml @@ -16,6 +16,8 @@ Item { Shape { id: shape anchors.fill: parent + layer.enabled: true + layer.samples: 4 // Workaround for Qt 6.5 and below, for Qt 6.6, just set "preferredRendererType" to "Shape.CurveRenderer" ShapePath { capStyle: ShapePath.RoundCap strokeWidth: 0 @@ -39,9 +41,11 @@ Item { width: shape.width height: shape.height anchors.centerIn: parent + layer.enabled: true + layer.samples: 4 ShapePath { capStyle: ShapePath.RoundCap - strokeWidth: control.borderWidth + strokeWidth: control.borderWidth * 2 strokeColor: control.borderColor fillColor: "transparent" joinStyle: ShapePath.RoundJoin diff --git a/lib_source/qml/Qt6/RibbonRectangle.qml b/lib_source/qml/Qt6/RibbonRectangle.qml index 7ef2343..62acbd2 100644 --- a/lib_source/qml/Qt6/RibbonRectangle.qml +++ b/lib_source/qml/Qt6/RibbonRectangle.qml @@ -18,6 +18,8 @@ Item { Shape { id: shape anchors.fill: parent + layer.enabled: true + layer.samples: 4 // Workaround for Qt 6.5 and below, for Qt 6.6, just set "preferredRendererType" to "Shape.CurveRenderer" ShapePath { capStyle: ShapePath.RoundCap strokeWidth: 0 @@ -41,9 +43,11 @@ Item { width: shape.width height: shape.height anchors.centerIn: parent + layer.enabled: true + layer.samples: 4 ShapePath { capStyle: ShapePath.RoundCap - strokeWidth: control.borderWidth + strokeWidth: control.borderWidth * 2 strokeColor: control.borderColor fillColor: "transparent" joinStyle: ShapePath.RoundJoin