Warning, /graphics/koko/src/qml/Dialog/ConfirmDiscardingChange.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu>
0002 // SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003
0004 import QtQuick 2.15
0005 import QtQuick.Controls 2.15 as QQC2
0006 import QtQuick.Layouts 1.15
0007 import org.kde.kirigami 2.15 as Kirigami
0008
0009 QQC2.Dialog {
0010 id: root
0011
0012 signal discardChanges()
0013
0014 x: Math.round((parent.width - width) / 2)
0015 y: Math.round((parent.height - height) / 2)
0016
0017 modal: true
0018
0019 ColumnLayout {
0020 Kirigami.Heading {
0021 text: i18n("Discard changes")
0022 }
0023 QQC2.Label {
0024 text: i18n("Are you sure you want to discard all changes?")
0025 }
0026 }
0027
0028 footer: QQC2.DialogButtonBox {
0029 QQC2.Button {
0030 text: i18n("Cancel")
0031 QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
0032 onClicked: root.close()
0033 }
0034
0035 QQC2.Button {
0036 text: i18n("Yes")
0037 QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
0038 onClicked: {
0039 root.discardChanges();
0040 root.close();
0041 }
0042 }
0043 }
0044
0045 background: Kirigami.ShadowedRectangle {
0046 radius: 7
0047 color: Kirigami.Theme.backgroundColor
0048
0049 border {
0050 width: 1
0051 color: Kirigami.ColorUtils.linearInterpolation(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, 0.3);
0052 }
0053
0054 shadow {
0055 size: Kirigami.Units.gridUnit
0056 yOffset: 4
0057 color: Qt.rgba(0, 0, 0, 0.2)
0058 }
0059
0060 Kirigami.Theme.inherit: false
0061 Kirigami.Theme.colorSet: Kirigami.Theme.View
0062 }
0063 }