Warning, /frameworks/qqc2-desktop-style/org.kde.desktop/Dialog.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.Dialog {
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)) + header.implicitHeight + footer.implicitHeight
0023 
0024     padding: Kirigami.Units.gridUnit
0025 
0026     enter: Transition {
0027         NumberAnimation {
0028             property: "opacity"
0029             from: 0
0030             to: 1
0031             easing.type: Easing.InOutQuad
0032             duration: Kirigami.Units.longDuration
0033         }
0034     }
0035 
0036     exit: Transition {
0037         NumberAnimation {
0038             property: "opacity"
0039             from: 1
0040             to: 0
0041             easing.type: Easing.InOutQuad
0042             duration: Kirigami.Units.longDuration
0043         }
0044     }
0045 
0046     contentItem: Item {}
0047 
0048     background: Kirigami.ShadowedRectangle {
0049         radius: 2
0050         color: Kirigami.Theme.backgroundColor
0051         property color borderColor: Kirigami.Theme.textColor
0052         border.color: Qt.rgba(borderColor.r, borderColor.g, borderColor.b, 0.3)
0053         border.width: 1
0054 
0055         shadow.xOffset: 0
0056         shadow.yOffset: 4
0057         shadow.color: Qt.rgba(0, 0, 0, 0.3)
0058         shadow.size: 16
0059     }
0060 
0061     header: Kirigami.Heading {
0062         text: control.title
0063         level: 2
0064         visible: control.title
0065         elide: Label.ElideRight
0066         padding: Kirigami.Units.gridUnit
0067         bottomPadding: 0
0068     }
0069 
0070     footer: DialogButtonBox {
0071         visible: count > 0
0072     }
0073 }