Warning, /frameworks/qqc2-desktop-style/org.kde.desktop/Popup.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
0003     SPDX-FileCopyrightText: 2017 The Qt Company Ltd.
0004 
0005     SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later
0006 */
0007 
0008 
0009 import QtQuick 2.6
0010 import QtQuick.Templates 2.15 as T
0011 import org.kde.kirigami 2.12 as Kirigami
0012 
0013 T.Popup {
0014     id: control
0015 
0016     implicitWidth: Math.max(background ? background.implicitWidth : 0,
0017                             contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0)
0018     implicitHeight: Math.max(background ? background.implicitHeight : 0,
0019                              contentWidth > 0 ? contentHeight + topPadding + bottomPadding : 0)
0020 
0021     contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
0022     contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
0023 
0024     padding: 12
0025     clip: true
0026 
0027     enter: Transition {
0028         NumberAnimation {
0029             property: "opacity"
0030             from: 0
0031             to: 1
0032             easing.type: Easing.InOutQuad
0033             duration: Kirigami.Units.longDuration
0034         }
0035     }
0036 
0037     exit: Transition {
0038         NumberAnimation {
0039             property: "opacity"
0040             from: 1
0041             to: 0
0042             easing.type: Easing.InOutQuad
0043             duration: Kirigami.Units.longDuration
0044         }
0045     }
0046 
0047     contentItem: Item {}
0048 
0049     background: Kirigami.ShadowedRectangle {
0050         radius: 2
0051         color: Kirigami.Theme.backgroundColor
0052 
0053         property color borderColor: Kirigami.Theme.textColor
0054         border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3)
0055         border.width: 1
0056 
0057         shadow.xOffset: 0
0058         shadow.yOffset: 4
0059         shadow.color: Qt.rgba(0, 0, 0, 0.3)
0060         shadow.size: 8
0061     }
0062 }