status-desktop/ui/StatusQ/sandbox/pages/StatusItemSelectorPage.qml
Noelia 1cbb3e2ad3 feat(CommunityPermissions): Created CommunityPermissionsView layout
- Created `CommunityPermissionsView` and integrated into the flow.
- Created `PermissionItem` component.
- Added `holdingsListModel`, `permissionsObjectModel` and `channelsListModel` flows with mocked data.
- Added `isPrivate` permission property.
- Added button header in `SettingsPageLayout`
- Added signals/methods for edit/duplicate/remove permissions
- Created new file `OperatorsUtils.qml` specific for `Operators`
2022-12-10 14:02:02 +01:00

62 lines
1.6 KiB
QML

import QtQuick 2.14
import QtQuick.Layouts 1.14
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Core.Utils 0.1
ColumnLayout {
spacing: 20
StatusItemSelector {
id: selector
icon: "qrc:/images/SNT.png"
iconSize: 24
title: "Item Selector Title"
defaultItemText: "Example: Empty items"
itemsModel: ListModel {
id: model
}
StatusDropdown {
id: dropdown
parent: selector.addButton
width: 200
contentItem: ColumnLayout {
spacing: 10
StatusInput {
id: input
text: "Sample"
Layout.fillWidth: true
}
StatusButton {
Layout.alignment: Qt.AlignHCenter
text: "Add element"
onClicked: {
model.append({
text: input.text,
imageSource: "qrc:/images/SNT.png",
operator: model.count > 0 ? OperatorsUtils.Operators.Or : OperatorsUtils.Operators.None
})
dropdown.close()
}
}
}
}
addButton.onClicked: {
dropdown.x = mouse.x
dropdown.y = mouse.y
dropdown.open()
}
}
StatusButton {
Layout.alignment: Qt.AlignHCenter
text: "Clear list"
onClicked: { selector.itemsModel.clear() }
}
}