Warning, /frameworks/knewstuff/src/qtquick/qml/private/MessageBoxSheet.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2020 Dan Leinir Turthra Jensen <admin@leinir.dk> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 import QtQuick 2.12 0008 import QtQuick.Controls 2.12 as QtControls 0009 import QtQuick.Layouts 1.12 as QtLayouts 0010 0011 import org.kde.kirigami 2.7 as Kirigami 0012 0013 Kirigami.OverlaySheet { 0014 id: component 0015 0016 property alias title: headerLabel.text 0017 property alias text: messageLabel.text 0018 property alias icon: messageIcon.source 0019 property list<QtObject> actions 0020 0021 showCloseButton: true 0022 header: Kirigami.Heading { 0023 id: headerLabel 0024 QtLayouts.Layout.fillWidth: true 0025 elide: Text.ElideRight 0026 } 0027 // This is a TextEdit rather than a label, because the QQC Label control 0028 // does not support text selection (and it's very useful to be able to 0029 // select error texts for searchy purposes) 0030 contentItem: QtLayouts.RowLayout { 0031 QtLayouts.Layout.preferredWidth: Kirigami.Units.gridUnit * 10 0032 QtLayouts.Layout.margins: Kirigami.Units.largeSpacing 0033 Kirigami.Icon { 0034 id: messageIcon 0035 QtLayouts.Layout.alignment: Qt.AlignTop 0036 visible: source !== "" 0037 } 0038 TextEdit { 0039 id: messageLabel 0040 QtLayouts.Layout.fillWidth: true 0041 QtLayouts.Layout.alignment: Qt.AlignVCenter 0042 wrapMode: Text.Wrap 0043 readOnly: true 0044 selectByMouse: true 0045 color: Kirigami.Theme.textColor 0046 selectedTextColor: Kirigami.Theme.highlightedTextColor 0047 selectionColor: Kirigami.Theme.highlightColor 0048 textFormat: TextEdit.AutoText 0049 onLinkActivated: Qt.openUrlExternally(link) 0050 } 0051 } 0052 footer: QtLayouts.RowLayout { 0053 Item { QtLayouts.Layout.fillWidth: true } 0054 Repeater { 0055 model: component.actions; 0056 QtControls.Button { 0057 action: modelData 0058 Connections { 0059 target: action 0060 onTriggered: component.close() 0061 } 0062 } 0063 } 0064 } 0065 }