| 1 |
// SPDX-FileCopyrightText: Nheko Contributors |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: GPL-3.0-or-later |
| 4 |
|
| 5 |
import QtQuick |
| 6 |
import QtQuick.Controls |
| 7 |
import im.nheko |
| 8 |
|
| 9 |
Menu { |
| 10 |
id: spacesMenu |
| 11 |
|
| 12 |
property string roomid |
| 13 |
|
| 14 |
property bool loadChildren: false |
| 15 |
|
| 16 |
title: qsTr("Add or remove from community...") |
| 17 |
|
| 18 |
onAboutToShow: loadChildren = true |
| 19 |
//onAboutToHide: loadChildren = false |
| 20 |
|
| 21 |
Component { |
| 22 |
id: level |
| 23 |
|
| 24 |
SpaceMenuLevel { |
| 25 |
childMenu: level |
| 26 |
roomid: spacesMenu.roomid |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
Instantiator { |
| 31 |
id: inst |
| 32 |
model: spacesMenu.loadChildren ? Communities.spaceChildrenListFromIndex(spacesMenu.roomid, -1) : undefined |
| 33 |
onObjectAdded: (idx, o) => { |
| 34 |
spacesMenu.insertMenu(idx, o) |
| 35 |
} |
| 36 |
onObjectRemoved: (index, object) => spacesMenu.removeMenu(object) |
| 37 |
|
| 38 |
delegate: level |
| 39 |
} |
| 40 |
} |