diff options
author | Matias Linares <matias@deprecated.org> | 2024-10-14 07:11:33 -0300 |
---|---|---|
committer | Matias Linares <matias@deprecated.org> | 2024-10-14 07:11:33 -0300 |
commit | 9157444f4e0bc50e16e6bd13c3e7284104e1d2e8 (patch) | |
tree | cef1f3618972c5dac7594b8c5d077d478287306f /kodereviewer/qml | |
parent | bc2d786dfdf4d7a0b3f57ca7e66f0daa78c56a87 (diff) | |
download | kodereviewer-9157444f4e0bc50e16e6bd13c3e7284104e1d2e8.tar.gz |
Add context drawer
Diffstat (limited to 'kodereviewer/qml')
-rw-r--r-- | kodereviewer/qml/KRContextDrawer.qml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/kodereviewer/qml/KRContextDrawer.qml b/kodereviewer/qml/KRContextDrawer.qml new file mode 100644 index 0000000..c3923fa --- /dev/null +++ b/kodereviewer/qml/KRContextDrawer.qml @@ -0,0 +1,36 @@ +import QtQuick +import QtQuick.Controls as QQC2 +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 + contentItem: QQC2.ScrollView { + implicitWidth: Kirigami.Units.gridUnit * 20 + ListView { + anchors.fill: parent + clip: true + id: menu + model: KDescendantsProxyModel { + id: descendantsModel + } + + delegate: Delegates.RoundedTreeDelegate { + required property string filename + text: filename + + highlighted: menu.currentItem ? menu.currentItem.filename == filename : false + onClicked: { + menu.currentIndex = index + } + } + } + } +} |