2023-03-20 12:29:05 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import AppLayouts.Profile.controls 1.0
|
|
|
|
|
|
|
|
ProfileShowcasePanel {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
settingsKey: "assets"
|
|
|
|
keyRole: "symbol"
|
2023-10-23 10:03:21 +00:00
|
|
|
roleNames: ["symbol", "name", "enabledNetworkBalance"]
|
|
|
|
filterFunc: (modelData) => !showcaseModel.hasItem(modelData.symbol)
|
2023-03-20 12:29:05 +00:00
|
|
|
hiddenPlaceholderBanner: qsTr("Assets here will show on your profile")
|
|
|
|
showcasePlaceholderBanner: qsTr("Assets here will be hidden from your profile")
|
|
|
|
|
|
|
|
draggableDelegateComponent: AssetShowcaseDelegate {
|
|
|
|
Drag.keys: ["x-status-draggable-showcase-item-hidden"]
|
|
|
|
showcaseObj: modelData
|
|
|
|
dragParent: dragParentData
|
|
|
|
visualIndex: visualIndexData
|
|
|
|
onShowcaseVisibilityRequested: {
|
|
|
|
var tmpObj = Object()
|
|
|
|
root.roleNames.forEach(role => tmpObj[role] = showcaseObj[role])
|
|
|
|
tmpObj.showcaseVisibility = value
|
|
|
|
showcaseModel.append(tmpObj)
|
|
|
|
showcaseVisibility = Constants.ShowcaseVisibility.NoOne // reset
|
|
|
|
}
|
|
|
|
}
|
|
|
|
showcaseDraggableDelegateComponent: AssetShowcaseDelegate {
|
|
|
|
Drag.keys: ["x-status-draggable-showcase-item"]
|
|
|
|
showcaseObj: modelData
|
|
|
|
dragParent: dragParentData
|
|
|
|
visualIndex: visualIndexData
|
|
|
|
dragAxis: Drag.YAxis
|
|
|
|
showcaseVisibility: !!modelData ? modelData.showcaseVisibility : Constants.ShowcaseVisibility.NoOne
|
|
|
|
onShowcaseVisibilityRequested: {
|
|
|
|
if (value === Constants.ShowcaseVisibility.NoOne) {
|
|
|
|
showcaseModel.remove(visualIndex)
|
|
|
|
} else {
|
|
|
|
showcaseModel.setProperty(visualIndex, "showcaseVisibility", value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|