diff options
Diffstat (limited to 'components/package/contents/ui/FolderListView.qml')
-rw-r--r-- | components/package/contents/ui/FolderListView.qml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index 6646d88f..e8600832 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml | |||
@@ -33,6 +33,23 @@ Rectangle { | |||
33 | 33 | ||
34 | color: Kirigami.Theme.textColor | 34 | color: Kirigami.Theme.textColor |
35 | 35 | ||
36 | KubeFramework.FolderController { | ||
37 | id: folderController | ||
38 | folder: root.currentFolder | ||
39 | } | ||
40 | |||
41 | Menu { | ||
42 | id: contextMenu | ||
43 | title: "Edit" | ||
44 | |||
45 | MenuItem { | ||
46 | text: "Synchronize" | ||
47 | onTriggered: { | ||
48 | folderController.synchronizeAction.execute() | ||
49 | } | ||
50 | } | ||
51 | } | ||
52 | |||
36 | TreeView { | 53 | TreeView { |
37 | id: treeView | 54 | id: treeView |
38 | 55 | ||
@@ -62,6 +79,18 @@ Rectangle { | |||
62 | alternatingRowColors: false | 79 | alternatingRowColors: false |
63 | headerVisible: false | 80 | headerVisible: false |
64 | 81 | ||
82 | MouseArea { | ||
83 | anchors.fill: parent | ||
84 | acceptedButtons: Qt.RightButton | ||
85 | onClicked: { | ||
86 | var index = parent.indexAt(mouse.x, mouse.y) | ||
87 | if (index.valid) { | ||
88 | folderController.folder = treeView.model.data(index, KubeFramework.FolderListModel.DomainObject) | ||
89 | contextMenu.popup() | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | |||
65 | style: TreeViewStyle { | 94 | style: TreeViewStyle { |
66 | 95 | ||
67 | rowDelegate: Rectangle { | 96 | rowDelegate: Rectangle { |