2022-03-23 15:38:23 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Dialogs 1.3
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Layout 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2022-05-18 12:21:03 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2022-03-23 15:38:23 +00:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Controls.Validators 0.1
|
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
import "../../controls/community"
|
|
|
|
|
2022-06-16 09:41:21 +00:00
|
|
|
import "../../../CommunitiesPortal/controls"
|
|
|
|
import "../../../CommunitiesPortal/panels"
|
|
|
|
|
2022-07-13 12:29:38 +00:00
|
|
|
StatusScrollView {
|
2022-03-23 15:38:23 +00:00
|
|
|
id: root
|
2022-08-03 20:16:43 +00:00
|
|
|
objectName: "communityEditPanelScrollView"
|
2022-03-23 15:38:23 +00:00
|
|
|
|
2023-01-26 08:41:07 +00:00
|
|
|
implicitWidth: contentWidth
|
|
|
|
implicitHeight: layout.childrenRect.height
|
2023-01-13 13:10:18 +00:00
|
|
|
|
2022-03-23 15:38:23 +00:00
|
|
|
property alias name: nameInput.text
|
|
|
|
property alias description: descriptionTextInput.text
|
2022-05-26 15:46:02 +00:00
|
|
|
property alias introMessage: introMessageTextInput.text
|
|
|
|
property alias outroMessage: outroMessageTextInput.text
|
|
|
|
property alias color: colorPicker.color
|
2022-06-09 14:59:54 +00:00
|
|
|
property alias tags: tagsPicker.tags
|
|
|
|
property alias selectedTags: tagsPicker.selectedTags
|
2022-05-26 15:46:02 +00:00
|
|
|
property alias options: options
|
|
|
|
|
|
|
|
property alias logoImageData: logoPicker.imageData
|
|
|
|
property alias logoImagePath: logoPicker.source
|
|
|
|
property alias logoCropRect: logoPicker.cropRect
|
|
|
|
property alias bannerImageData: bannerPicker.imageData
|
|
|
|
property alias bannerPath: bannerPicker.source
|
|
|
|
property alias bannerCropRect: bannerPicker.cropRect
|
2022-03-23 15:38:23 +00:00
|
|
|
|
2022-06-22 12:16:21 +00:00
|
|
|
property size bottomReservedSpace: Qt.size(0, 0)
|
|
|
|
property bool bottomReservedSpaceActive: false
|
|
|
|
|
2023-01-27 00:12:48 +00:00
|
|
|
readonly property bool saveChangesButtonEnabled: !((nameInput.input.dirty && !nameInput.valid) ||
|
|
|
|
(descriptionTextInput.input.dirty && !descriptionTextInput.valid))
|
2022-06-22 12:16:21 +00:00
|
|
|
|
2022-03-23 15:38:23 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: layout
|
|
|
|
|
2023-01-13 13:10:18 +00:00
|
|
|
width: 608
|
2023-01-26 08:41:07 +00:00
|
|
|
height: parent.height
|
2023-01-13 13:10:18 +00:00
|
|
|
|
2022-03-23 15:38:23 +00:00
|
|
|
spacing: 12
|
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityNameInput {
|
2022-03-23 15:38:23 +00:00
|
|
|
id: nameInput
|
2022-08-03 20:16:43 +00:00
|
|
|
input.edit.objectName: "editCommunityNameInput"
|
2022-03-23 15:38:23 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Component.onCompleted: nameInput.input.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
}
|
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityDescriptionInput {
|
2022-03-23 15:38:23 +00:00
|
|
|
id: descriptionTextInput
|
2022-08-03 20:16:43 +00:00
|
|
|
input.edit.objectName: "editCommunityDescriptionInput"
|
2022-03-23 15:38:23 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityLogoPicker {
|
|
|
|
id: logoPicker
|
2022-08-03 20:16:43 +00:00
|
|
|
objectName: "editCommunityLogoPicker"
|
2022-05-26 15:46:02 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2022-05-23 18:53:51 +00:00
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityBannerPicker {
|
|
|
|
id: bannerPicker
|
2022-08-03 20:16:43 +00:00
|
|
|
objectName: "editCommunityBannerPicker"
|
2022-05-26 15:46:02 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2022-05-23 18:53:51 +00:00
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityColorPicker {
|
|
|
|
id: colorPicker
|
2022-08-03 20:16:43 +00:00
|
|
|
objectName: "editCommunityColorPicker"
|
2022-06-16 09:41:21 +00:00
|
|
|
onPick: Global.openPopup(pickColorComponent)
|
2022-05-26 15:46:02 +00:00
|
|
|
Layout.fillWidth: true
|
2022-06-16 09:41:21 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: pickColorComponent
|
|
|
|
|
|
|
|
StatusStackModal {
|
2022-06-27 17:41:28 +00:00
|
|
|
anchors.centerIn: parent
|
2022-06-28 10:55:33 +00:00
|
|
|
width: 640
|
2022-06-16 09:41:21 +00:00
|
|
|
replaceItem: CommunityColorPanel {
|
|
|
|
Component.onCompleted: color = colorPicker.color
|
|
|
|
onAccepted: {
|
|
|
|
colorPicker.color = color;
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onClosed: destroy()
|
|
|
|
}
|
|
|
|
}
|
2022-05-26 15:46:02 +00:00
|
|
|
}
|
2022-05-23 18:53:51 +00:00
|
|
|
|
2022-06-09 14:59:54 +00:00
|
|
|
CommunityTagsPicker {
|
|
|
|
id: tagsPicker
|
2022-08-03 20:16:43 +00:00
|
|
|
objectName: "editCommunityTagsPicker"
|
2022-06-16 09:41:21 +00:00
|
|
|
onPick: Global.openPopup(pickTagsComponent)
|
2022-06-09 14:59:54 +00:00
|
|
|
Layout.fillWidth: true
|
2022-06-16 09:41:21 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: pickTagsComponent
|
|
|
|
|
|
|
|
StatusStackModal {
|
2022-06-27 17:41:28 +00:00
|
|
|
anchors.centerIn: parent
|
2022-06-28 10:55:33 +00:00
|
|
|
width: 640
|
2022-06-16 09:41:21 +00:00
|
|
|
replaceItem: CommunityTagsPanel {
|
|
|
|
Component.onCompleted: {
|
|
|
|
tags = tagsPicker.tags;
|
|
|
|
selectedTags = tagsPicker.selectedTags;
|
|
|
|
}
|
|
|
|
onAccepted: {
|
|
|
|
tagsPicker.selectedTags = selectedTags;
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onClosed: destroy()
|
|
|
|
}
|
|
|
|
}
|
2022-06-09 14:59:54 +00:00
|
|
|
}
|
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
StatusModalDivider {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.bottomMargin: -layout.spacing
|
|
|
|
}
|
2022-05-23 18:53:51 +00:00
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityOptions {
|
|
|
|
id: options
|
2023-01-26 08:41:07 +00:00
|
|
|
Layout.fillWidth: true
|
2022-03-23 15:38:23 +00:00
|
|
|
}
|
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
StatusModalDivider {
|
2022-03-23 15:38:23 +00:00
|
|
|
Layout.fillWidth: true
|
2022-05-26 15:46:02 +00:00
|
|
|
Layout.topMargin: -layout.spacing
|
|
|
|
Layout.bottomMargin: 8
|
2022-03-23 15:38:23 +00:00
|
|
|
}
|
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityIntroMessageInput {
|
|
|
|
id: introMessageTextInput
|
2022-08-03 20:16:43 +00:00
|
|
|
input.edit.objectName: "editCommunityIntroInput"
|
2022-05-26 15:46:02 +00:00
|
|
|
Layout.fillWidth: true
|
2022-07-29 08:00:37 +00:00
|
|
|
minimumHeight: 108
|
|
|
|
maximumHeight: 108
|
2022-05-26 15:46:02 +00:00
|
|
|
}
|
2022-05-04 13:08:04 +00:00
|
|
|
|
2022-05-26 15:46:02 +00:00
|
|
|
CommunityOutroMessageInput {
|
|
|
|
id: outroMessageTextInput
|
2022-08-03 20:16:43 +00:00
|
|
|
input.edit.objectName: "editCommunityOutroInput"
|
2022-04-13 20:54:17 +00:00
|
|
|
Layout.fillWidth: true
|
2022-05-04 13:08:04 +00:00
|
|
|
}
|
|
|
|
|
2022-03-23 15:38:23 +00:00
|
|
|
Item {
|
2022-06-22 12:16:21 +00:00
|
|
|
// settingsDirtyToastMessage placeholder
|
|
|
|
visible: root.bottomReservedSpaceActive
|
|
|
|
implicitWidth: root.bottomReservedSpace.width
|
|
|
|
implicitHeight: root.bottomReservedSpace.height
|
2022-03-23 15:38:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|