Changeset View
Changeset View
Standalone View
Standalone View
src/controls/private/DefaultCardBackground.qml
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org> | 2 | * SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org> | ||
3 | * | 3 | * | ||
4 | * SPDX-License-Identifier: LGPL-2.0-or-later | 4 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||
5 | */ | 5 | */ | ||
6 | 6 | | |||
7 | import QtQuick 2.6 | 7 | import QtQuick 2.6 | ||
8 | import org.kde.kirigami 2.11 as Kirigami | 8 | import org.kde.kirigami 2.12 as Kirigami | ||
9 | 9 | | |||
10 | Rectangle { | 10 | Kirigami.ShadowedRectangle { | ||
11 | color: Kirigami.Theme.backgroundColor | 11 | color: Kirigami.Theme.backgroundColor | ||
12 | 12 | | |||
13 | CornerShadow { | 13 | radius: Kirigami.Units.smallSpacing | ||
14 | id: topLeft | 14 | | ||
15 | corner: Qt.BottomRightCorner | 15 | shadow.size: Kirigami.Units.largeSpacing | ||
16 | z: -1 | 16 | shadow.color: Qt.rgba(0.0, 0.0, 0.0, 0.15) | ||
17 | anchors { | 17 | shadow.yOffset: Kirigami.Units.devicePixelRatio * 2 | ||
18 | right: parent.left | 18 | | ||
19 | bottom: parent.top | 19 | border.width: Kirigami.Units.devicePixelRatio | ||
20 | margins: margin | 20 | border.color: Qt.tint(Kirigami.Theme.textColor, | ||
21 | bottomMargin: margin - 1 | 21 | Qt.rgba(color.r, color.g, color.b, 0.6)) | ||
22 | } | | |||
23 | } | | |||
24 | CornerShadow { | | |||
25 | id: topRight | | |||
26 | corner: Qt.BottomLeftCorner | | |||
27 | z: -1 | | |||
28 | anchors { | | |||
29 | left: parent.right | | |||
30 | bottom: parent.top | | |||
31 | margins: margin | | |||
32 | bottomMargin: margin - 1 | | |||
33 | } | | |||
34 | } | | |||
35 | CornerShadow { | | |||
36 | id: bottomLeft | | |||
37 | corner: Qt.TopRightCorner | | |||
38 | z: -1 | | |||
39 | anchors { | | |||
40 | right: parent.left | | |||
41 | top: parent.bottom | | |||
42 | margins: margin | | |||
43 | } | | |||
44 | } | | |||
45 | CornerShadow { | | |||
46 | id: bottomRight | | |||
47 | corner: Qt.TopLeftCorner | | |||
48 | z: -1 | | |||
49 | anchors { | | |||
50 | left: parent.right | | |||
51 | top: parent.bottom | | |||
52 | margins: margin | | |||
53 | } | | |||
54 | } | | |||
55 | EdgeShadow { | | |||
56 | edge: Qt.BottomEdge | | |||
57 | z: -1 | | |||
58 | anchors { | | |||
59 | left: bottomLeft.right | | |||
60 | right: bottomRight.left | | |||
61 | bottom: parent.top | | |||
62 | bottomMargin: - 1 | | |||
63 | } | | |||
64 | } | | |||
65 | EdgeShadow { | | |||
66 | edge: Qt.TopEdge | | |||
67 | z: -1 | | |||
68 | anchors { | | |||
69 | left: topLeft.right | | |||
70 | right: topRight.left | | |||
71 | top: parent.bottom | | |||
72 | } | | |||
73 | } | | |||
74 | EdgeShadow { | | |||
75 | edge: Qt.LeftEdge | | |||
76 | z: -1 | | |||
77 | anchors { | | |||
78 | top: topRight.bottom | | |||
79 | bottom: bottomRight.top | | |||
80 | left: parent.right | | |||
81 | } | | |||
82 | } | | |||
83 | EdgeShadow { | | |||
84 | edge: Qt.RightEdge | | |||
85 | z: -1 | | |||
86 | anchors { | | |||
87 | top: topLeft.bottom | | |||
88 | bottom: bottomLeft.top | | |||
89 | right: parent.left | | |||
90 | } | | |||
91 | } | | |||
92 | } | 22 | } | ||
93 | 23 | |