Warning, /education/khangman/src/qml/SelectionDialog.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2023 Carl Schwan <carl@carlschwan.eu>
0002 // SPDX-License-Identifier: LGPL-2.1-or-later
0003
0004 import QtQuick
0005 import QtQuick.Controls as QQC2
0006 import QtQuick.Layouts
0007 import org.kde.kirigami as Kirigami
0008 import org.kde.kirigamiaddons.delegates as Delegates
0009 import org.kde.kirigamiaddons.components as Components
0010
0011 QQC2.Dialog {
0012 id: root
0013
0014 property alias model: selectionListView.model
0015 property alias delegate: selectionListView.delegate
0016 property alias currentIndex: selectionListView.currentIndex
0017
0018 x: Math.round((parent.width - width) / 2)
0019 y: Math.round((parent.height - height) / 2)
0020 z: Kirigami.OverlayZStacking.z
0021
0022 width: 400
0023 height: 200
0024
0025 leftPadding: 0
0026 topPadding: 0
0027 rightPadding: 0
0028 bottomPadding: 0
0029
0030 modal: true
0031
0032 parent: applicationWindow().QQC2.Overlay.overlay
0033
0034 background: Components.DialogRoundedBackground {}
0035
0036 header: ColumnLayout {
0037 width: parent.width
0038 spacing: 0
0039
0040 RowLayout {
0041 Layout.fillWidth: true
0042 Layout.margins: Kirigami.Units.smallSpacing
0043 spacing: Kirigami.Units.smallSpacing
0044
0045 Kirigami.Heading {
0046 text: root.title
0047 Layout.fillWidth: true
0048 Layout.leftMargin: Kirigami.Units.smallSpacing
0049 Layout.rightMargin: Kirigami.Units.smallSpacing
0050 }
0051
0052 QQC2.ToolButton {
0053 icon.name: "dialog-close"
0054 text: i18nc("@action:button", "Close")
0055 display: QQC2.Button.IconOnly
0056 onClicked: root.close();
0057 }
0058 }
0059
0060 Kirigami.Separator {
0061 Layout.fillWidth: true
0062 }
0063 }
0064
0065 contentItem: ColumnLayout {
0066 ListView {
0067 id: selectionListView
0068
0069 Layout.fillWidth: true
0070 Layout.fillHeight: true
0071
0072 Kirigami.Theme.colorSet: Kirigami.Theme.View
0073
0074 currentIndex : -1
0075 focus: true
0076 clip: true
0077 }
0078 }
0079 }
0080
0081