fix(@wallet): left bar selection

fixes #10999
This commit is contained in:
Anthony Laibe 2023-06-09 09:26:14 +02:00 committed by Anthony Laibe
parent cc7a2e9d32
commit 3d6a5b1785
3 changed files with 12 additions and 6 deletions

View File

@ -137,6 +137,7 @@ method notifyFilterChanged(self: Module) =
self.transactionsModule.filterChanged(self.filter.addresses, self.filter.chainIds)
self.accountsModule.filterChanged(self.filter.addresses, self.filter.chainIds, self.filter.excludeWatchOnly)
self.sendModule.filterChanged(self.filter.addresses, self.filter.chainIds)
self.view.filterChanged(self.filter.addresses[0], self.filter.excludeWatchOnly, self.filter.allAddresses)
method getCurrencyAmount*(self: Module, amount: float64, symbol: string): CurrencyAmount =
return self.controller.getCurrencyAmount(amount, symbol)

View File

@ -39,6 +39,8 @@ QtObject:
QtProperty[string] currentCurrency:
read = getCurrentCurrency
proc filterChanged*(self: View, addresses: string, excludeWatchOnly: bool, allAddresses: bool) {.signal.}
proc totalCurrencyBalanceChanged*(self: View) {.signal.}
proc getTotalCurrencyBalance(self: View): QVariant {.slot.} =

View File

@ -32,18 +32,18 @@ Rectangle {
property var changeSelectedAccount: function(){}
property bool showSavedAddresses: false
property bool showAllAccounts: true
property string currentAddress: ""
onShowSavedAddressesChanged: {
root.currentAddress = ""
walletAccountsListView.headerItem.highlighted = root.showAllAccounts
walletAccountsListView.footerItem.button.highlighted = root.showSavedAddresses
}
onShowAllAccountsChanged: {
root.currentAddress = ""
walletAccountsListView.headerItem.highlighted = root.showAllAccounts
walletAccountsListView.footerItem.button.highlighted = root.showSavedAddresses
if (root.showAllAccounts) {
selectAllAccounts()
}
}
property var emojiPopup: null
@ -125,6 +125,10 @@ Rectangle {
function onDestroyAddAccountPopup() {
addAccount.active = false
}
function onFilterChanged(address, excludeWatchOnly, allAddresses) {
root.currentAddress = allAddresses ? "" : address
root.showAllAccounts = allAddresses
}
}
MouseArea {
@ -197,8 +201,7 @@ Rectangle {
objectName: "walletAccount-" + model.name
readonly property bool itemLoaded: !model.assetsLoading // needed for e2e tests
width: ListView.view.width - Style.current.padding * 2
highlighted: !ListView.view.footerItem.button.highlighted &&
RootStore.overview.mixedcaseAddress.toLowerCase() === model.address.toLowerCase()
highlighted: root.currentAddress.toLowerCase() === model.address.toLowerCase()
anchors.horizontalCenter: !!parent ? parent.horizontalCenter : undefined
title: model.name
subTitle: LocaleUtils.currencyAmountToLocaleString(model.currencyBalance)
@ -294,7 +297,7 @@ Rectangle {
cursorShape: Qt.PointingHandCursor
onClicked: {
root.showSavedAddresses = false
root.showAllAccounts = true
root.selectAllAccounts()
}
hoverEnabled: true
}