fix: Fix missing setup url for new opeed tab

Closes: #4107
This commit is contained in:
B.Melnik 2021-11-15 15:36:22 +03:00 committed by Khushboo-dev-cpp
parent a57fb330bd
commit defefa1bfe
7 changed files with 35 additions and 172 deletions

@ -1 +1 @@
Subproject commit ce8d3231be71f26c4fb7de9a510edbd6c31a7800 Subproject commit 2040d0f8578e5adadeb9d291511d25a1eda79595

View File

@ -50,9 +50,9 @@ StatusModal {
StatusAccountSelector { StatusAccountSelector {
id: selectFromAccount id: selectFromAccount
accounts: root.store.walletModelInst.accountsView.accounts accounts: root.store.accounts
selectedAccount: { selectedAccount: {
const currAcc = root.store.walletModelInst.accountsView.currentAccount const currAcc = root.store.currentAccount
if (currAcc.walletType !== Constants.watchWalletType) { if (currAcc.walletType !== Constants.watchWalletType) {
return currAcc return currAcc
} }
@ -113,6 +113,7 @@ StatusModal {
id: txtAmount id: txtAmount
selectedAccount: selectFromAccount.selectedAccount selectedAccount: selectFromAccount.selectedAccount
defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency defaultCurrency: root.store.walletModelInst.balanceView.defaultCurrency
currentCurrency: root.store.currentCurrency
getFiatValue: root.store.walletModelInst.balanceView.getFiatValue getFiatValue: root.store.walletModelInst.balanceView.getFiatValue
getCryptoValue: root.store.walletModelInst.balanceView.getCryptoValue getCryptoValue: root.store.walletModelInst.balanceView.getCryptoValue
validateBalance: !root.isRequested validateBalance: !root.isRequested

View File

@ -18,6 +18,10 @@ QtObject {
property var activeCommunity: chatsModelInst.communities.activeCommunity property var activeCommunity: chatsModelInst.communities.activeCommunity
property var accounts: walletSectionAccounts.model
property var currentAccount: walletSectionCurrent
property var currentCurrency: walletSection.currentCurrency
function copyToClipboard(text) { function copyToClipboard(text) {
chatsModelInst.copyToClipboard(text); chatsModelInst.copyToClipboard(text);
} }

View File

@ -5,9 +5,10 @@ import QtGraphicalEffects 1.13
import utils 1.0 import utils 1.0
import StatusQ.Controls 0.1
import "../" import "../"
import "../panels" import "../panels"
import "../controls"
import "." import "."
Item { Item {
@ -20,6 +21,7 @@ Item {
//% "Please enter an amount" //% "Please enter an amount"
property string noInputErrorMessage: qsTrId("please-enter-an-amount") property string noInputErrorMessage: qsTrId("please-enter-an-amount")
property string defaultCurrency: "USD" property string defaultCurrency: "USD"
property string currentCurrency: ""
property alias selectedFiatAmount: txtFiatBalance.text property alias selectedFiatAmount: txtFiatBalance.text
property alias selectedAmount: inputAmount.text property alias selectedAmount: inputAmount.text
property var selectedAccount property var selectedAccount
@ -165,22 +167,29 @@ Item {
} }
} }
AssetSelector { StatusAssetSelector {
id: selectAsset id: selectAsset
width: 86 width: 86
height: 28 height: 28
anchors.top: inputAmount.top anchors.top: inputAmount.top
anchors.topMargin: Style.current.bigPadding + 14 anchors.topMargin: Style.current.bigPadding + 14
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding anchors.rightMargin: Style.current.smallPadding
onSelectedAssetChanged: { defaultToken: Style.png("tokens/DEFAULT-TOKEN@3x")
if (!selectAsset.selectedAsset) { getCurrencyBalanceString: function (currencyBalance) {
return return Utils.toLocaleString(currencyBalance.toFixed(2), localAppSettings.locale, {"currency": true}) + " " + root.currentCurrency.toUpperCase()
} }
txtBalance.text = Utils.stripTrailingZeros(selectAsset.selectedAsset.value) tokenAssetSourceFn: function (symbol) {
if (inputAmount.text === "" || isNaN(inputAmount.text)) { return symbol ? Style.png("tokens/" + symbol) : defaultToken
return }
} onSelectedAssetChanged: {
if (!selectAsset.selectedAsset) {
return
}
txtBalance.text = Utils.stripTrailingZeros(parseFloat(selectAsset.selectedAsset.balance).toFixed(4))
if (inputAmount.text === "" || isNaN(inputAmount.text)) {
return
}
txtFiatBalance.text = root.getFiatValue(inputAmount.text, selectAsset.selectedAsset.symbol, root.defaultCurrency) txtFiatBalance.text = root.getFiatValue(inputAmount.text, selectAsset.selectedAsset.symbol, root.defaultCurrency)
root.validate(true) root.validate(true)
} }

View File

@ -1,151 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import QtGraphicalEffects 1.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import utils 1.0
Item {
id: root
property var assets
property var selectedAsset
width: 86
height: 24
function resetInternal() {
assets = undefined
selectedAsset = undefined
}
onSelectedAssetChanged: {
if (selectedAsset && selectedAsset.symbol) {
iconImg.image.source = Style.png("tokens/" + selectedAsset.symbol.toUpperCase())
selectedTextField.text = selectedAsset.symbol.toUpperCase()
}
}
onAssetsChanged: {
if (!assets) {
return
}
selectedAsset = {
name: assets.rowData(0, "name"),
symbol: assets.rowData(0, "symbol"),
value: assets.rowData(0, "balance"),
fiatBalanceDisplay: assets.rowData(0, "currencyBalance"),
address: assets.rowData(0, "address"),
fiatBalance: assets.rowData(0, "currencyBalance")
}
}
StatusSelect {
id: select
width: parent.width
bgColor: Style.current.transparent
bgColorHover: Style.current.secondaryHover
model: root.assets
caretRightMargin: 0
select.radius: 6
select.height: root.height
selectMenu.width: 342
selectedItemComponent: Item {
anchors.fill: parent
StatusRoundedImage {
id: iconImg
anchors.left: parent.left
anchors.leftMargin: 4
width: 24
height: 24
anchors.verticalCenter: parent.verticalCenter
}
StatusBaseText {
id: selectedTextField
anchors.left: iconImg.right
anchors.leftMargin: 4
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 15
height: 22
verticalAlignment: Text.AlignVCenter
color: Theme.palette.directColor1
}
}
selectMenu.delegate: menuItem
}
Component {
id: menuItem
MenuItem {
id: itemContainer
property bool isFirstItem: index === 0
property bool isLastItem: index === assets.count - 1
width: parent.width
height: 72
StatusRoundedImage {
id: iconImg
anchors.left: parent.left
anchors.leftMargin: 16
anchors.verticalCenter: parent.verticalCenter
image.source: Style.png("tokens/" + symbol.toUpperCase())
}
Column {
anchors.left: iconImg.right
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
StatusBaseText {
text: symbol.toUpperCase()
font.pixelSize: 15
color: Theme.palette.directColor1
}
StatusBaseText {
text: name
color: Theme.palette.baseColor1
font.pixelSize: 15
}
}
Column {
anchors.right: parent.right
anchors.rightMargin: 16
anchors.verticalCenter: parent.verticalCenter
StatusBaseText {
font.pixelSize: 15
text: parseFloat(balance).toFixed(4) + " " + symbol
color: Theme.palette.directColor1
}
StatusBaseText {
font.pixelSize: 15
anchors.right: parent.right
height: 22
text: currencyBalance.toString().toUpperCase()
color: Theme.palette.baseColor1
}
}
background: Rectangle {
color: itemContainer.highlighted ? Theme.palette.statusSelect.menuItemHoverBackgroundColor : Theme.palette.statusSelect.menuItemBackgroundColor
}
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: itemContainer
onClicked: {
root.selectedAsset = { address, name, balance, symbol, currencyBalance, fiatBalanceDisplay: "" }
select.selectMenu.close()
}
}
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -1,7 +1,6 @@
AddressInput 1.0 AddressInput.qml AddressInput 1.0 AddressInput.qml
AddressSourceSelector 1.0 AddressSourceSelector.qml AddressSourceSelector 1.0 AddressSourceSelector.qml
AssetAndAmountInput 1.0 AssetAndAmountInput.qml AssetAndAmountInput 1.0 AssetAndAmountInput.qml
AssetSelector 1.0 AssetSelector.qml
ContactSelector 1.0 ContactSelector.qml ContactSelector 1.0 ContactSelector.qml
ContactsListAndSearch 1.0 ContactsListAndSearch.qml ContactsListAndSearch 1.0 ContactsListAndSearch.qml
CopyToClipBoardButton 1.0 CopyToClipBoardButton.qml CopyToClipBoardButton 1.0 CopyToClipBoardButton.qml

View File

@ -127,6 +127,7 @@ ModalPopup {
id: txtAmount id: txtAmount
selectedAccount: selectFromAccount.selectedAccount selectedAccount: selectFromAccount.selectedAccount
defaultCurrency: walletModel.balanceView.defaultCurrency defaultCurrency: walletModel.balanceView.defaultCurrency
currentCurrency: walletSection.currentCurrency
getFiatValue: walletModel.balanceView.getFiatValue getFiatValue: walletModel.balanceView.getFiatValue
getCryptoValue: walletModel.balanceView.getCryptoValue getCryptoValue: walletModel.balanceView.getCryptoValue
width: stack.width width: stack.width