mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
meta: replace rectangles with DankRectangle shapes
This commit is contained in:
54
Widgets/DankRectangle.qml
Normal file
54
Widgets/DankRectangle.qml
Normal file
@@ -0,0 +1,54 @@
|
||||
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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user