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 0010 import QtQuick.Controls as QQC2 0011 import QtQuick.Templates as T 0012 import org.kde.kirigami as Kirigami 0013 0014 T.Dialog { 0015 id: control 0016 0017 z: Kirigami.OverlayZStacking.z 0018 0019 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, 0020 contentWidth + leftPadding + rightPadding, 0021 implicitHeaderWidth, 0022 implicitFooterWidth) 0023 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, 0024 contentHeight + topPadding + bottomPadding 0025 + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0) 0026 + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0)) 0027 0028 padding: Kirigami.Units.gridUnit 0029 0030 // black background, fades in and out 0031 QQC2.Overlay.modal: Rectangle { 0032 color: Qt.rgba(0, 0, 0, 0.3) 0033 0034 // the opacity of the item is changed internally by QQuickPopup on open/close 0035 Behavior on opacity { 0036 OpacityAnimator { 0037 duration: Kirigami.Units.longDuration 0038 easing.type: Easing.InOutQuad 0039 } 0040 } 0041 } 0042 0043 enter: Transition { 0044 NumberAnimation { 0045 property: "opacity" 0046 from: 0 0047 to: 1 0048 easing.type: Easing.InOutQuad 0049 duration: Kirigami.Units.longDuration 0050 } 0051 } 0052 0053 exit: Transition { 0054 NumberAnimation { 0055 property: "opacity" 0056 from: 1 0057 to: 0 0058 easing.type: Easing.InOutQuad 0059 duration: Kirigami.Units.longDuration 0060 } 0061 } 0062 0063 contentItem: Item {} 0064 0065 background: Kirigami.ShadowedRectangle { 0066 radius: 2 0067 color: Kirigami.Theme.backgroundColor 0068 border.color: Kirigami.ColorUtils.linearInterpolation(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, Kirigami.Theme.frameContrast) 0069 border.width: 1 0070 0071 shadow.xOffset: 0 0072 shadow.yOffset: 4 0073 shadow.color: Qt.rgba(0, 0, 0, 0.3) 0074 shadow.size: 16 0075 } 0076 0077 header: Kirigami.Heading { 0078 text: control.title 0079 level: 2 0080 visible: control.title 0081 elide: Label.ElideRight 0082 padding: Kirigami.Units.gridUnit 0083 bottomPadding: 0 0084 } 0085 0086 footer: DialogButtonBox { 0087 visible: count > 0 0088 } 0089 }