RibbonRectangle: Add padding property.

This commit is contained in:
Mentalflow 2024-09-08 17:59:13 +08:00
parent f317fcbde7
commit 2a8a1816dd
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
2 changed files with 22 additions and 2 deletions

View File

@ -11,6 +11,10 @@ Item {
property int topRightRadius: radius property int topRightRadius: radius
property int bottomLeftRadius: radius property int bottomLeftRadius: radius
property int bottomRightRadius: radius property int bottomRightRadius: radius
property int topPadding: 0
property int leftPadding: 0
property int rightPadding: 0
property int bottomPadding: 0
property real borderWidth: 0 property real borderWidth: 0
property string borderColor: "transparent" property string borderColor: "transparent"
default property alias contentItem: container.data default property alias contentItem: container.data
@ -65,7 +69,13 @@ Item {
Item{ Item{
id: container id: container
anchors.fill: parent anchors{
fill: parent
topMargin: control.topPadding
bottomMargin: control.bottomPadding
leftMargin: control.leftPadding
rightMargin: control.rightPadding
}
clip: true clip: true
layer.enabled: true layer.enabled: true
layer.effect: OpacityMask { layer.effect: OpacityMask {

View File

@ -11,6 +11,10 @@ Item {
property int topRightRadius: radius property int topRightRadius: radius
property int bottomLeftRadius: radius property int bottomLeftRadius: radius
property int bottomRightRadius: radius property int bottomRightRadius: radius
property int topPadding: 0
property int leftPadding: 0
property int rightPadding: 0
property int bottomPadding: 0
property real borderWidth: 0 property real borderWidth: 0
property string borderColor: "transparent" property string borderColor: "transparent"
default property alias contentItem: container.data default property alias contentItem: container.data
@ -65,7 +69,13 @@ Item {
Item{ Item{
id: container id: container
anchors.fill: parent anchors{
fill: parent
topMargin: control.topPadding
bottomMargin: control.bottomPadding
leftMargin: control.leftPadding
rightMargin: control.rightPadding
}
clip: true clip: true
layer.enabled: true layer.enabled: true
layer.effect: OpacityMask { layer.effect: OpacityMask {