RibbonRectangle: Add antialiasing and widen the border as default Rectangle's border.

This commit is contained in:
Mentalflow 2024-08-11 18:09:42 +08:00
parent 1a48510a1b
commit 10cb6a248c
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
2 changed files with 10 additions and 2 deletions

View File

@ -16,6 +16,8 @@ Item {
Shape { Shape {
id: shape id: shape
anchors.fill: parent 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 { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: 0 strokeWidth: 0
@ -39,9 +41,11 @@ Item {
width: shape.width width: shape.width
height: shape.height height: shape.height
anchors.centerIn: parent anchors.centerIn: parent
layer.enabled: true
layer.samples: 4
ShapePath { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: control.borderWidth strokeWidth: control.borderWidth * 2
strokeColor: control.borderColor strokeColor: control.borderColor
fillColor: "transparent" fillColor: "transparent"
joinStyle: ShapePath.RoundJoin joinStyle: ShapePath.RoundJoin

View File

@ -18,6 +18,8 @@ Item {
Shape { Shape {
id: shape id: shape
anchors.fill: parent 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 { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: 0 strokeWidth: 0
@ -41,9 +43,11 @@ Item {
width: shape.width width: shape.width
height: shape.height height: shape.height
anchors.centerIn: parent anchors.centerIn: parent
layer.enabled: true
layer.samples: 4
ShapePath { ShapePath {
capStyle: ShapePath.RoundCap capStyle: ShapePath.RoundCap
strokeWidth: control.borderWidth strokeWidth: control.borderWidth * 2
strokeColor: control.borderColor strokeColor: control.borderColor
fillColor: "transparent" fillColor: "transparent"
joinStyle: ShapePath.RoundJoin joinStyle: ShapePath.RoundJoin