2023-03-20 12:29:05 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
2024-02-15 17:26:05 +00:00
|
|
|
import QtQuick.Layouts 1.15
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1 as CoreUtils
|
|
|
|
|
|
|
|
import mainui 1.0
|
|
|
|
import AppLayouts.Profile.panels 1.0
|
2024-02-15 17:26:05 +00:00
|
|
|
import AppLayouts.Profile.controls 1.0
|
2023-10-23 11:36:33 +00:00
|
|
|
import shared.stores 1.0
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
Popups {
|
|
|
|
popupParent: root
|
|
|
|
rootStore: QtObject {}
|
2023-10-23 11:36:33 +00:00
|
|
|
communityTokensStore: CommunityTokensStore {}
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
|
2024-02-15 17:26:05 +00:00
|
|
|
ListModel {
|
|
|
|
id: emptyModel
|
|
|
|
}
|
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
ListModel {
|
|
|
|
id: communitiesModel
|
2023-11-09 14:24:05 +00:00
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
Component.onCompleted:
|
|
|
|
append([{
|
|
|
|
id: "0x0001",
|
|
|
|
name: "Test community",
|
|
|
|
joined: true,
|
2023-06-19 14:16:35 +00:00
|
|
|
memberRole: Constants.memberRole.owner,
|
2023-07-21 21:05:42 +00:00
|
|
|
isControlNode: true,
|
2023-03-20 12:29:05 +00:00
|
|
|
image: ModelsData.icons.dribble,
|
|
|
|
color: "yellow"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "0x0002",
|
|
|
|
name: "Test community 2",
|
|
|
|
joined: true,
|
2023-06-19 14:16:35 +00:00
|
|
|
memberRole: Constants.memberRole.none,
|
2023-07-21 21:05:42 +00:00
|
|
|
isControlNode: false,
|
2023-03-20 12:29:05 +00:00
|
|
|
image: ModelsData.collectibles.custom,
|
|
|
|
color: "peach"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "0x0004",
|
|
|
|
name: "Test community 3",
|
|
|
|
joined: true,
|
2023-06-19 14:16:35 +00:00
|
|
|
memberRole: Constants.memberRole.none,
|
2023-07-21 21:05:42 +00:00
|
|
|
isControlNode: false,
|
2023-03-20 12:29:05 +00:00
|
|
|
image: "",
|
|
|
|
color: "whitesmoke"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: "0x0005",
|
|
|
|
name: "Test community 4",
|
|
|
|
joined: true,
|
2023-06-19 14:16:35 +00:00
|
|
|
memberRole: Constants.memberRole.admin,
|
2023-07-21 21:05:42 +00:00
|
|
|
isControlNode: false,
|
2023-03-20 12:29:05 +00:00
|
|
|
image: ModelsData.icons.spotify,
|
|
|
|
color: "green"
|
|
|
|
},
|
|
|
|
])
|
|
|
|
}
|
|
|
|
|
2023-11-09 14:24:05 +00:00
|
|
|
ListModel {
|
|
|
|
id: inShowcaseCommunitiesModel
|
|
|
|
|
2024-02-15 17:26:05 +00:00
|
|
|
property int hiddenCount: emptyModelChecker.checked ? 0 : communitiesModel.count - count
|
|
|
|
|
2023-11-09 14:24:05 +00:00
|
|
|
signal baseModelFilterConditionsMayHaveChanged()
|
|
|
|
|
|
|
|
function setVisibilityByIndex(index, visibility) {
|
|
|
|
if (visibility === Constants.ShowcaseVisibility.NoOne) {
|
|
|
|
remove(index)
|
|
|
|
} else {
|
2024-02-15 17:26:05 +00:00
|
|
|
get(index).showcaseVisibility = visibility
|
2023-11-09 14:24:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function setVisibility(id, visibility) {
|
|
|
|
for (let i = 0; i < count; ++i) {
|
|
|
|
if (get(i).id === id) {
|
|
|
|
setVisibilityByIndex(i, visibility)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function hasItemInShowcase(id) {
|
|
|
|
for (let i = 0; i < count; ++i) {
|
|
|
|
if (get(i).id === id) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
function upsertItemJson(item) {
|
|
|
|
append(JSON.parse(item))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
StatusScrollView { // wrapped in a ScrollView on purpose; to simulate SettingsContentBase.qml
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.preferredHeight: 500
|
2024-02-15 17:26:05 +00:00
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
ProfileShowcaseCommunitiesPanel {
|
|
|
|
id: showcasePanel
|
|
|
|
width: 500
|
2024-02-15 17:26:05 +00:00
|
|
|
baseModel: emptyModelChecker.checked ? emptyModel : communitiesModel
|
2023-11-09 14:24:05 +00:00
|
|
|
showcaseModel: inShowcaseCommunitiesModel
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 200
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
2024-02-15 17:26:05 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Button {
|
|
|
|
text: "Reset (clear settings)"
|
|
|
|
onClicked: showcasePanel.reset()
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: emptyModelChecker
|
|
|
|
|
|
|
|
text: "Empty model"
|
|
|
|
checked: false
|
|
|
|
|
|
|
|
onClicked: showcasePanel.reset()
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Panels
|
2023-10-03 11:56:30 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?node-id=14580-339532&t=RkXAEv3G6mp3EUvl-0
|
|
|
|
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?node-id=14729-231402&t=RkXAEv3G6mp3EUvl-0
|
|
|
|
// https://www.figma.com/file/idUoxN7OIW2Jpp3PMJ1Rl8/%E2%9A%99%EF%B8%8F-Settings-%7C-Desktop?node-id=14609-236656&t=RkXAEv3G6mp3EUvl-0
|