MauiKit Controls

EdgeShadow.qml
1/*
2 * Copyright 2016 Marco Martin <mart@kde.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Library General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick
21import Qt5Compat.GraphicalEffects
22import org.mauikit.controls as Maui
23
24LinearGradient
25{
26 id: control
27 /**
28 * edge: enumeration
29 * This property holds the edge of the shadow that will determine
30 * the direction of the gradient.
31 * The acceptable values are:
32 * Qt.TopEdge: The top edge of the content item.
33 * Qt.LeftEdge: The left edge of the content item (default).
34 * Qt.RightEdge: The right edge of the content item.
35 * Qt.BottomEdge: The bottom edge of the content item.
36 */
37 property int edge: Qt.LeftEdge
38
39 /**
40 *
41 */
42 property color color: Maui.ColorUtils.linearInterpolation(Maui.Theme.alternateBackgroundColor, Maui.Theme.textColor, 0.2)
43
44 implicitWidth: Maui.Style.units.gridUnit*3
45
46 opacity: 0.4
47 start: Qt.point(0, height/2)
48 end: Qt.point( width, height/2)
49
50
51 transform: [
52 Scale{ xScale: control.edge === Qt.RightEdge ? -1 : 1 },
53 Translate {x: control.edge === Qt.RightEdge ? control.width : 0}
54 ]
55
56 gradient: Gradient
57 {
58 GradientStop
59 {
60 position: 0
61 color: control.color
62 }
63
64 GradientStop
65 {
66 position: 0.8
67 color: "transparent"
68 }
69
70 GradientStop
71 {
72 position: 1
73 color: "transparent"
74 }
75 }
76}
77
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:56:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.