Warning, /frameworks/kirigami/src/controls/private/EdgeShadow.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 * SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 import QtQuick 0008 import org.kde.kirigami as Kirigami 0009 0010 Item { 0011 id: shadow 0012 /** 0013 * @brief This property holds the edge of the shadow that will determine the direction of the gradient. 0014 * The acceptable values are: 0015 * * ``Qt.TopEdge``: the top edge of the content item. 0016 * * ``Qt.LeftEdge``: the left edge of the content item 0017 * * ``Qt.RightEdge``: the right edge of the content item. 0018 * * ``Qt.BottomEdge``: the bottom edge of the content item. 0019 * 0020 * @see Qt::Edges 0021 */ 0022 property int edge: Qt.LeftEdge 0023 0024 property int radius: Kirigami.Units.gridUnit 0025 implicitWidth: radius 0026 implicitHeight: radius 0027 0028 Rectangle { 0029 x: shadow.width / 2 - width / 2 0030 y: shadow.height / 2 - height / 2 0031 width: (shadow.edge === Qt.LeftEdge || shadow.edge === Qt.RightEdge) ? shadow.height : shadow.width 0032 height: (shadow.edge === Qt.LeftEdge || shadow.edge === Qt.RightEdge) ? shadow.width : shadow.height 0033 rotation: { 0034 switch (shadow.edge) { 0035 case Qt.TopEdge: return 0; 0036 case Qt.LeftEdge: return 270; 0037 case Qt.RightEdge: return 90; 0038 case Qt.BottomEdge: return 180; 0039 } 0040 } 0041 0042 gradient: Gradient { 0043 GradientStop { 0044 position: 0.0 0045 color: Qt.rgba(0, 0, 0, 0.25) 0046 } 0047 GradientStop { 0048 position: 0.20 0049 color: Qt.rgba(0, 0, 0, 0.1) 0050 } 0051 GradientStop { 0052 position: 0.35 0053 color: Qt.rgba(0, 0, 0, 0.02) 0054 } 0055 GradientStop { 0056 position: 1.0 0057 color: "transparent" 0058 } 0059 } 0060 } 0061 } 0062