fix: fix a couple of QML warnings

This commit is contained in:
Jonathan Rainville 2020-10-26 13:10:14 -04:00
parent db7d99bf53
commit 84ff2b21a9
5 changed files with 9 additions and 13 deletions

View File

@ -525,7 +525,7 @@ QtObject:
proc isHistoryFetched*(self: WalletView, address: string): bool {.slot.} =
return self.currentTransactions.rowCount() > 0
proc loadingTrxHistory*(self: WalletView, isLoading: bool) {.signal.}
proc loadingTrxHistoryChanged*(self: WalletView, isLoading: bool) {.signal.}
proc loadTransactionsForAccount*(self: WalletView, address: string) {.slot.} =
var bn = "latest"
@ -533,7 +533,7 @@ QtObject:
bn = self.currentTransactions.getLastTxBlockNumber()
# spawn'ed function cannot have a 'var' parameter
let blockNumber = bn
self.loadingTrxHistory(true)
self.loadingTrxHistoryChanged(true)
spawnAndSend(self, "setTrxHistoryResult") do:
$(%*{
"address": address,
@ -550,7 +550,7 @@ QtObject:
if address == self.currentAccount.address:
self.setCurrentTransactions(
self.accounts.getAccount(index).transactions)
self.loadingTrxHistory(false)
self.loadingTrxHistoryChanged(false)
proc resolveENS*(self: WalletView, ens: string) {.slot.} =
spawnAndSend(self, "ensResolved") do:

View File

@ -204,7 +204,7 @@ Rectangle {
}
}
property int networkId: _web3Provider.networkId
property int networkId: (_web3Provider && _web3Provider.networkId) || -1
}
WebChannel {

View File

@ -60,7 +60,7 @@ Item {
Connections {
target: walletModel
onHistoryWasFetched: checkIfHistoryIsBeingFetched()
onLoadingTrxHistory: {
onLoadingTrxHistoryChanged: {
loadingImg.active = isLoading
}
}
@ -255,10 +255,6 @@ Item {
fetchHistory()
loadMoreButton.loadedMore = true
}
onLoadingTrxHistory: {
loadingImg.active = isLoading
}
}
}
}

View File

@ -19,7 +19,7 @@ Popup {
height: 68
padding: 0
margins: 0
width: Math.Max(Math.max(titleText.width, linkText.width) + toastImage.width + 12 * 4, 343)
width: Math.max(Math.max(titleText.width, linkText.width) + toastImage.width + 12 * 4, 343)
x: parent.width - width - Style.current.bigPadding
y: parent.height - height - Style.current.bigPadding

View File

@ -555,13 +555,13 @@ Rectangle {
anchors.rightMargin: 0
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
height: {
if (messageInputField.height <= messageInput.defaultInputFieldHeight) {
if (messageInputField.implicitHeight <= messageInput.defaultInputFieldHeight) {
return messageInput.defaultInputFieldHeight
}
if (messageInputField.height >= messageInput.maxInputFieldHeight) {
if (messageInputField.implicitHeight >= messageInput.maxInputFieldHeight) {
return messageInput.maxInputFieldHeight
}
return messageInputField.height
return messageInputField.implicitHeight
}
TextArea {