From 84ff2b21a90bcaef5523adef93c55a93f582fe9a Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 26 Oct 2020 13:10:14 -0400 Subject: [PATCH] fix: fix a couple of QML warnings --- src/app/wallet/view.nim | 6 +++--- ui/app/AppLayouts/Browser/BrowserLayout.qml | 2 +- ui/app/AppLayouts/Wallet/HistoryTab.qml | 6 +----- ui/shared/ToastMessage.qml | 2 +- ui/shared/status/StatusChatInput.qml | 6 +++--- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/app/wallet/view.nim b/src/app/wallet/view.nim index 98bfc99a68..70b145fccd 100644 --- a/src/app/wallet/view.nim +++ b/src/app/wallet/view.nim @@ -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: diff --git a/ui/app/AppLayouts/Browser/BrowserLayout.qml b/ui/app/AppLayouts/Browser/BrowserLayout.qml index 8df166f877..4c74e6d298 100644 --- a/ui/app/AppLayouts/Browser/BrowserLayout.qml +++ b/ui/app/AppLayouts/Browser/BrowserLayout.qml @@ -204,7 +204,7 @@ Rectangle { } } - property int networkId: _web3Provider.networkId + property int networkId: (_web3Provider && _web3Provider.networkId) || -1 } WebChannel { diff --git a/ui/app/AppLayouts/Wallet/HistoryTab.qml b/ui/app/AppLayouts/Wallet/HistoryTab.qml index f236871f49..ff90a5b495 100644 --- a/ui/app/AppLayouts/Wallet/HistoryTab.qml +++ b/ui/app/AppLayouts/Wallet/HistoryTab.qml @@ -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 - } } } } diff --git a/ui/shared/ToastMessage.qml b/ui/shared/ToastMessage.qml index c2f9646942..b3461210aa 100644 --- a/ui/shared/ToastMessage.qml +++ b/ui/shared/ToastMessage.qml @@ -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 diff --git a/ui/shared/status/StatusChatInput.qml b/ui/shared/status/StatusChatInput.qml index 1112f1d628..34c3d781b2 100644 --- a/ui/shared/status/StatusChatInput.qml +++ b/ui/shared/status/StatusChatInput.qml @@ -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 {