filter out watch only accounts in account list for sending transactions
This commit is contained in:
parent
f2a56c70e1
commit
212f33b3c0
|
@ -15,6 +15,7 @@ type
|
|||
Balance = UserRole + 4
|
||||
FiatBalance = UserRole + 5
|
||||
Assets = UserRole + 6
|
||||
WalletType = UserRole + 7
|
||||
|
||||
QtObject:
|
||||
type AccountList* = ref object of QAbstractListModel
|
||||
|
@ -92,6 +93,7 @@ QtObject:
|
|||
of AccountRoles.Balance: result = newQVariant(account.balance)
|
||||
of AccountRoles.FiatBalance: result = newQVariant(fmt"{account.realFiatBalance:>.2f}")
|
||||
of AccountRoles.Assets: result = newQVariant(accountView.assets)
|
||||
of AccountRoles.WalletType: result = newQVariant(account.walletType)
|
||||
|
||||
method roleNames(self: AccountList): Table[int, string] =
|
||||
{ AccountRoles.Name.int:"name",
|
||||
|
@ -99,7 +101,8 @@ QtObject:
|
|||
AccountRoles.Color.int:"iconColor",
|
||||
AccountRoles.Balance.int:"balance",
|
||||
AccountRoles.FiatBalance.int:"fiatBalance",
|
||||
AccountRoles.Assets.int:"assets" }.toTable
|
||||
AccountRoles.Assets.int:"assets",
|
||||
AccountRoles.WalletType.int:"walletType" }.toTable
|
||||
|
||||
proc addAccountToList*(self: AccountList, account: WalletAccount) =
|
||||
if account.iconColor == "":
|
||||
|
|
|
@ -160,6 +160,7 @@ Item {
|
|||
id: menuItem
|
||||
MenuItem {
|
||||
id: itemContainer
|
||||
visible: walletType !== 'watch'
|
||||
property bool isFirstItem: index === 0
|
||||
property bool isLastItem: index === accounts.rowCount() - 1
|
||||
|
||||
|
@ -169,7 +170,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
height: accountName.height + 14 + accountAddress.height + 14
|
||||
height: walletType === 'watch' ? 0 : (accountName.height + 14 + accountAddress.height + 14)
|
||||
SVGImage {
|
||||
id: iconImg
|
||||
anchors.left: parent.left
|
||||
|
|
Loading…
Reference in New Issue