Files
monoshell/BarShape.qml

44 lines
1.4 KiB
QML

import QtQuick
import QtQuick.Effects
import QtQuick.Shapes
Shape {
id: background
preferredRendererType: Shape.CurveRenderer
required property var color
required property var radius
ShapePath {
strokeWidth: 0
fillColor: color
startX: 0
startY: 0
PathArc {
x: radius; y: Math.min(radius, background.height/2)
radiusX: radius; radiusY: y
direction: PathArc.Clockwise
}
PathLine { x: radius; y: background.height - Math.min(radius, background.height/2) }
PathArc {
x: radius * 2; y: background.height
radiusX: radius; radiusY: Math.min(radius, background.height/2)
direction: PathArc.Counterclockwise
}
PathLine { x: background.width - radius * 2; y: background.height }
PathArc {
x: background.width - radius; y: background.height - Math.min(radius, background.height/2)
radiusX: radius; radiusY: Math.min(radius, background.height/2)
direction: PathArc.Counterclockwise
}
PathLine { x: background.width - radius; y: Math.min(radius, background.height/2) }
PathArc {
x: background.width; y: 0
radiusX: radius; radiusY: Math.min(radius, background.height/2)
direction: PathArc.Clockwise
}
}
layer.enabled: true
layer.effect: MultiEffect {
shadowEnabled: true
}
}