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 QtQuick.Effects
22import org.mauikit.controls as Maui
23
24Rectangle
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 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
48 transform: [
49 Scale{ xScale: control.edge === Qt.RightEdge ? -1 : 1 },
50 Translate {x: control.edge === Qt.RightEdge ? control.width : 0}
51 ]
52
53 gradient: Gradient
54 {
55 orientation: Qt.Horizontal
56 GradientStop
57 {
58 position: 0
59 color: control.color
60 }
61
62 GradientStop
63 {
64 position: 0.8
65 color: "transparent"
66 }
67
68 GradientStop
69 {
70 position: 1
71 color: "transparent"
72 }
73 }
74}
75
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:46:39 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.