summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/KRContextDrawer.qml
blob: c3923fa651f36cb03896eacaa69d1575c0ba9d21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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
                }
            }
        }
    }
}