summaryrefslogtreecommitdiff
path: root/modules/launcher/Background.qml
blob: 7bffd26168aced56bad7e9c8eff046e71e76f273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import "root:/config"
import QtQuick
import QtQuick.Shapes

Shape {
    id: root

    required property real wrapperWidth
    required property real realWrapperHeight
    readonly property int rounding: Appearance.rounding.large
    readonly property int roundingY: Math.min(rounding, realWrapperHeight / 2)
    readonly property real wrapperHeight: realWrapperHeight - 1 // Pixel issues :sob:

    preferredRendererType: Shape.CurveRenderer
    opacity: Appearance.transparency.enabled ? Appearance.transparency.base : 1

    ShapePath {
        strokeWidth: -1
        fillColor: Appearance.colours.m3surface

        startY: root.wrapperHeight

        PathArc {
            relativeX: root.rounding
            relativeY: -root.roundingY
            radiusX: root.rounding
            radiusY: root.roundingY
            direction: PathArc.Counterclockwise
        }
        PathLine {
            relativeX: 0
            y: root.roundingY
        }
        PathArc {
            relativeX: root.rounding
            relativeY: -root.roundingY
            radiusX: root.rounding
            radiusY: root.roundingY
        }
        PathLine {
            x: root.wrapperWidth - root.rounding * 2
        }
        PathArc {
            relativeX: root.rounding
            relativeY: root.roundingY
            radiusX: root.rounding
            radiusY: root.roundingY
        }
        PathLine {
            relativeX: 0
            y: root.wrapperHeight - root.roundingY
        }
        PathArc {
            relativeX: root.rounding
            relativeY: root.roundingY
            radiusX: root.rounding
            radiusY: root.roundingY
            direction: PathArc.Counterclockwise
        }
    }
}