fix: cleanup and fixes after introducing the new assets model
This commit is contained in:
parent
f2482ab003
commit
5080499d29
|
@ -48,7 +48,7 @@ SplitView {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
controller: ManageTokensController {
|
controller: ManageTokensController {
|
||||||
sourceModel: ctrlEmptyModel.checked ? null : assetsModel
|
sourceModel: ctrlEmptyModel.checked ? null : walletAssetStore.groupedAccountAssetsModel
|
||||||
settingsKey: "WalletAssets"
|
settingsKey: "WalletAssets"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import StatusQ.Core 0.1
|
||||||
import StatusQ.Models 0.1
|
import StatusQ.Models 0.1
|
||||||
|
|
||||||
import AppLayouts.Wallet.panels 1.0
|
import AppLayouts.Wallet.panels 1.0
|
||||||
|
import AppLayouts.Wallet.stores 1.0
|
||||||
|
|
||||||
import utils 1.0
|
import utils 1.0
|
||||||
|
|
||||||
|
@ -20,8 +21,8 @@ SplitView {
|
||||||
|
|
||||||
orientation: Qt.Horizontal
|
orientation: Qt.Horizontal
|
||||||
|
|
||||||
ManageTokensModel {
|
readonly property WalletAssetsStore walletAssetStore: WalletAssetsStore {
|
||||||
id: assetsModel
|
assetsWithFilteredBalances: groupedAccountsAssetsModel
|
||||||
}
|
}
|
||||||
|
|
||||||
ManageCollectiblesModel {
|
ManageCollectiblesModel {
|
||||||
|
@ -41,7 +42,7 @@ SplitView {
|
||||||
|
|
||||||
ManageTokensController {
|
ManageTokensController {
|
||||||
id: assetsController
|
id: assetsController
|
||||||
sourceModel: ctrlEmptyModel.checked ? null : assetsModel
|
sourceModel: ctrlEmptyModel.checked ? null : walletAssetStore.groupedAccountAssetsModel
|
||||||
settingsKey: "WalletAssets"
|
settingsKey: "WalletAssets"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +62,23 @@ SplitView {
|
||||||
width: 500
|
width: 500
|
||||||
assetsController: assetsController
|
assetsController: assetsController
|
||||||
collectiblesController: collectiblesController
|
collectiblesController: collectiblesController
|
||||||
|
|
||||||
|
getCurrencyAmount: function (balance, symbol) {
|
||||||
|
return ({
|
||||||
|
amount: balance,
|
||||||
|
symbol: symbol,
|
||||||
|
displayDecimals: 2,
|
||||||
|
stripTrailingZeroes: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getCurrentCurrencyAmount: function (balance) {
|
||||||
|
return ({
|
||||||
|
amount: balance,
|
||||||
|
symbol: "USD",
|
||||||
|
displayDecimals: 2,
|
||||||
|
stripTrailingZeroes: false
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,6 +191,12 @@ ColumnLayout {
|
||||||
Component {
|
Component {
|
||||||
id: hiddenPanel
|
id: hiddenPanel
|
||||||
ManageHiddenPanel {
|
ManageHiddenPanel {
|
||||||
|
getCurrencyAmount: function (balance, symbol) {
|
||||||
|
return root.getCurrencyAmount(balance, symbol)
|
||||||
|
}
|
||||||
|
getCurrentCurrencyAmount: function (balance) {
|
||||||
|
return root.getCurrentCurrencyAmount(balance)
|
||||||
|
}
|
||||||
assetsController: d.assetsController
|
assetsController: d.assetsController
|
||||||
collectiblesController: d.collectiblesController
|
collectiblesController: d.collectiblesController
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ DropArea {
|
||||||
width: root.width
|
width: root.width
|
||||||
title: model.name
|
title: model.name
|
||||||
|
|
||||||
readonly property var totalBalance: aggregator.value/(10 ** model.decimals)
|
readonly property real totalBalance: aggregator.value/(10 ** model.decimals)
|
||||||
|
|
||||||
secondaryTitle: root.isCollectible ? (root.isCommunityToken ? qsTr("Community minted") : model.collectionName || model.collectionUid) :
|
secondaryTitle: root.isCollectible ? (root.isCommunityToken ? qsTr("Community minted") : model.collectionName || model.collectionUid) :
|
||||||
hovered || menuBtn.menuVisible ? "%1 • %2".arg(LocaleUtils.currencyAmountToLocaleString(root.getCurrencyAmount(totalBalance, model.symbol)))
|
hovered || menuBtn.menuVisible ? "%1 • %2".arg(LocaleUtils.currencyAmountToLocaleString(root.getCurrencyAmount(totalBalance, model.symbol)))
|
||||||
|
@ -123,7 +123,7 @@ DropArea {
|
||||||
|
|
||||||
SumAggregator {
|
SumAggregator {
|
||||||
id: aggregator
|
id: aggregator
|
||||||
model: root.balances
|
model: root.balances ?? null
|
||||||
roleName: "balance"
|
roleName: "balance"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,6 @@ DropArea {
|
||||||
readonly property int childCount: model.enabledNetworkBalance // NB using "balance" as "count" in the grouped model
|
readonly property int childCount: model.enabledNetworkBalance // NB using "balance" as "count" in the grouped model
|
||||||
readonly property alias title: groupedCommunityTokenDelegate.title
|
readonly property alias title: groupedCommunityTokenDelegate.title
|
||||||
|
|
||||||
property var getCurrencyAmount: function (balance, symbol) {}
|
|
||||||
property var getCurrentCurrencyAmount: function(balance){}
|
|
||||||
|
|
||||||
ListView.onRemove: SequentialAnimation {
|
ListView.onRemove: SequentialAnimation {
|
||||||
PropertyAction { target: root; property: "ListView.delayRemove"; value: true }
|
PropertyAction { target: root; property: "ListView.delayRemove"; value: true }
|
||||||
NumberAnimation { target: root; property: "scale"; to: 0; easing.type: Easing.InOutQuad }
|
NumberAnimation { target: root; property: "scale"; to: 0; easing.type: Easing.InOutQuad }
|
||||||
|
|
|
@ -21,7 +21,7 @@ Control {
|
||||||
readonly property bool hasSettings: root.controller.hasSettings
|
readonly property bool hasSettings: root.controller.hasSettings
|
||||||
|
|
||||||
property var getCurrencyAmount: function (balance, symbol) {}
|
property var getCurrencyAmount: function (balance, symbol) {}
|
||||||
property var getCurrentCurrencyAmount: function(balance){}
|
property var getCurrentCurrencyAmount: function(balance) {}
|
||||||
|
|
||||||
background: null
|
background: null
|
||||||
|
|
||||||
|
@ -134,12 +134,6 @@ Control {
|
||||||
controller: root.controller
|
controller: root.controller
|
||||||
dragParent: root
|
dragParent: root
|
||||||
dragEnabled: root.controller.communityTokenGroupsModel.count > 1
|
dragEnabled: root.controller.communityTokenGroupsModel.count > 1
|
||||||
getCurrencyAmount: function (balance, symbol) {
|
|
||||||
return root.getCurrencyAmount(balance, symbol)
|
|
||||||
}
|
|
||||||
getCurrentCurrencyAmount: function (balance) {
|
|
||||||
return root.getCurrentCurrencyAmount(balance)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,9 @@ Control {
|
||||||
required property var assetsController
|
required property var assetsController
|
||||||
required property var collectiblesController
|
required property var collectiblesController
|
||||||
|
|
||||||
|
property var getCurrencyAmount: function (balance, symbol) {}
|
||||||
|
property var getCurrentCurrencyAmount: function (balance) {}
|
||||||
|
|
||||||
readonly property bool dirty: false // never dirty, the "show xxx" actions are immediate
|
readonly property bool dirty: false // never dirty, the "show xxx" actions are immediate
|
||||||
readonly property bool hasSettings: root.assetsController.hasSettings || root.collectiblesController.hasSettings
|
readonly property bool hasSettings: root.assetsController.hasSettings || root.collectiblesController.hasSettings
|
||||||
|
|
||||||
|
@ -155,6 +158,12 @@ Control {
|
||||||
dragParent: null
|
dragParent: null
|
||||||
dragEnabled: false
|
dragEnabled: false
|
||||||
isHidden: true
|
isHidden: true
|
||||||
|
getCurrencyAmount: function (balance, symbol) {
|
||||||
|
return root.getCurrencyAmount(balance, symbol)
|
||||||
|
}
|
||||||
|
getCurrentCurrencyAmount: function (balance) {
|
||||||
|
return root.getCurrentCurrencyAmount(balance)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue