import QtQuick import QtQuick.Controls as QQC2 import QtQuick.Layouts import org.kde.kirigami as Kirigami import org.kde.kirigamiaddons.delegates as Delegates import org.kde.kitemmodels import org.deprecated.kodereviewer 1.0 Kirigami.ContextDrawer { id: contextDrawer modal: false handleVisible: false property alias model: descendantsModel.model width: Kirigami.Units.gridUnit * 20 signal fileSelected(string filename, string text) contentItem: ColumnLayout { id: mainLayout implicitWidth: Kirigami.Units.gridUnit * 20 QQC2.ToolBar { id: toolbar Layout.fillWidth: true Layout.preferredHeight: pageStack.globalToolBar.preferredHeight contentItem: RowLayout { Kirigami.Heading { Layout.fillWidth: true text: "Files" } } } QQC2.ScrollView { Layout.fillWidth: true Layout.fillHeight: true ListView { anchors.fill: parent clip: true id: menu model: KDescendantsProxyModel { id: descendantsModel } delegate: Delegates.RoundedTreeDelegate { padding: 4 required property string filename required property string iconName required property string path required property string patch required property bool isFile text: filename icon.name: iconName highlighted: menu.currentItem ? menu.currentItem.path == path : false onClicked: { menu.currentIndex = index if (isFile) { contextDrawer.fileSelected(filename, patch) } } } } } } }