fix: Minors fixes for issues found when using StatusFloatingButtons and implementing new SendModal (#748)

1. Fix the issue of floating buttons having incorrect color in Dark theme
2. Added balances param in StatusAssetSelector. ideally should be removed in another task as it is not the correct place for business logic
This commit is contained in:
Khushboo-dev-cpp 2022-07-14 00:05:42 +02:00 committed by GitHub
parent e2d42289f7
commit c697467c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -419,6 +419,7 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I
height: button.height height: button.height
radius: 8 radius: 8
visible: visibleIndices.includes(index) visible: visibleIndices.includes(index)
color: Theme.palette.statusAppLayout.backgroundColor
StatusButton { StatusButton {
id: button id: button
topPadding: 8 topPadding: 8

View File

@ -13,6 +13,7 @@ Item {
property var assets property var assets
property var selectedAsset property var selectedAsset
property string defaultToken: "" property string defaultToken: ""
property string userSelectedToken: ""
property var tokenAssetSourceFn: function (symbol) { property var tokenAssetSourceFn: function (symbol) {
return "" return ""
} }
@ -128,16 +129,25 @@ Item {
background: Rectangle { background: Rectangle {
color: itemContainer.highlighted ? Theme.palette.statusSelect.menuItemHoverBackgroundColor : Theme.palette.statusSelect.menuItemBackgroundColor color: itemContainer.highlighted ? Theme.palette.statusSelect.menuItemHoverBackgroundColor : Theme.palette.statusSelect.menuItemBackgroundColor
} }
// To-do move this out of StatusQ, this involves dependency on BE code
Component.onCompleted: { Component.onCompleted: {
if(index === 0 ) { if(userSelectedToken === "") {
selectedAsset = { name: name, symbol: symbol, totalBalance: totalBalance, totalCurrencyBalance: totalCurrencyBalance} if(index === 0) {
selectedAsset = { name: name, symbol: symbol, totalBalance: totalBalance, totalCurrencyBalance: totalCurrencyBalance, balances: balances}
}
} else {
if(symbol === userSelectedToken) {
selectedAsset = { name: name, symbol: symbol, totalBalance: totalBalance, totalCurrencyBalance: totalCurrencyBalance, balances: balances}
}
} }
} }
MouseArea { MouseArea {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
anchors.fill: itemContainer anchors.fill: itemContainer
onClicked: { onClicked: {
selectedAsset = {name: name, symbol: symbol, totalBalance: totalBalance, totalCurrencyBalance: totalCurrencyBalance} userSelectedToken = symbol
// To-do move this out of StatusQ, this involves dependency on BE code
selectedAsset = {name: name, symbol: symbol, totalBalance: totalBalance, totalCurrencyBalance: totalCurrencyBalance, balances: balances}
select.selectMenu.close() select.selectMenu.close()
} }
} }

View File

@ -99,6 +99,7 @@ Row {
height: button.height height: button.height
radius: 8 radius: 8
visible: floatingButtons.model.count > 3 visible: floatingButtons.model.count > 3
color: Theme.palette.statusAppLayout.backgroundColor
StatusButton { StatusButton {
id: button id: button
implicitHeight: 32 implicitHeight: 32