1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00
Files
DankMaterialShell/quickshell/Widgets/DankRectangle.qml
2025-11-12 17:18:45 -05:00

55 lines
2.0 KiB
QML

import QtQuick
import QtQuick.Shapes
import qs.Common
Item {
id: root
property color color: Theme.surfaceContainer
property color borderColor: Theme.outlineMedium
property real borderWidth: 1
property real radius: Theme.cornerRadius
property color overlayColor: "transparent"
Shape {
anchors.fill: parent
preferredRendererType: Shape.CurveRenderer
ShapePath {
fillColor: root.color
strokeColor: root.borderColor
strokeWidth: root.borderWidth
startX: root.radius
startY: 0
PathLine { x: root.width - root.radius; y: 0 }
PathQuad { x: root.width; y: root.radius; controlX: root.width; controlY: 0 }
PathLine { x: root.width; y: root.height - root.radius }
PathQuad { x: root.width - root.radius; y: root.height; controlX: root.width; controlY: root.height }
PathLine { x: root.radius; y: root.height }
PathQuad { x: 0; y: root.height - root.radius; controlX: 0; controlY: root.height }
PathLine { x: 0; y: root.radius }
PathQuad { x: root.radius; y: 0; controlX: 0; controlY: 0 }
}
ShapePath {
fillColor: root.overlayColor
strokeColor: "transparent"
strokeWidth: 0
startX: root.radius
startY: 0
PathLine { x: root.width - root.radius; y: 0 }
PathQuad { x: root.width; y: root.radius; controlX: root.width; controlY: 0 }
PathLine { x: root.width; y: root.height - root.radius }
PathQuad { x: root.width - root.radius; y: root.height; controlX: root.width; controlY: root.height }
PathLine { x: root.radius; y: root.height }
PathQuad { x: 0; y: root.height - root.radius; controlX: 0; controlY: root.height }
PathLine { x: 0; y: root.radius }
PathQuad { x: root.radius; y: 0; controlX: 0; controlY: 0 }
}
}
}