KNewStuff

Shadow.qml
1/*
2 SPDX-FileCopyrightText: 2018 Aleix Pol Gonzalez <aleixpol@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7import QtQuick
8
9import org.kde.kirigami as Kirigami
10
11Item {
12 id: shadow
13
14 property int edge: Qt.LeftEdge
15
16 width: Kirigami.Units.gridUnit / 2
17 height: Kirigami.Units.gridUnit / 2
18
19 Rectangle {
20 x: shadow.width / 2 - width / 2
21 y: shadow.height / 2 - height / 2
22 width: (shadow.edge === Qt.LeftEdge || shadow.edge === Qt.RightEdge) ? shadow.height : shadow.width
23 height: (shadow.edge === Qt.LeftEdge || shadow.edge === Qt.RightEdge) ? shadow.width : shadow.height
24 rotation: {
25 switch (shadow.edge) {
26 case Qt.TopEdge: return 0;
27 case Qt.LeftEdge: return 270;
28 case Qt.RightEdge: return 90;
29 case Qt.BottomEdge: return 180;
30 }
31 }
32 gradient: Gradient {
33 GradientStop {
34 position: 0.3
35 color: Qt.rgba(0, 0, 0, 0.1)
36 }
37 GradientStop {
38 position: 1.0
39 color: "transparent"
40 }
41 }
42 }
43}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.