Fix/wallet small fixes (#10427)

* fix(wallet): back button #10374

* fix(wallet): Bottom bar missing #10394

* fix(Wallet): Remove WalletFooter flickering

* fix(@desktop/wallet): Added footer for section layout
This commit is contained in:
Cuteivist 2023-04-26 19:31:34 +02:00 committed by GitHub
parent c44e46a6a5
commit 75d17b4a07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 116 additions and 106 deletions

View File

@ -66,6 +66,11 @@ SplitView {
This property holds the right panel of the component.
*/
property Component rightPanel
/*!
\qmlproperty Component StatusAppLayout::footer
This property holds the footer of the component.
*/
property Item footer
/*!
\qmlproperty bool StatusAppLayout::showRightPanel
@ -134,6 +139,12 @@ SplitView {
}
}
onFooterChanged: {
if (!!footer) {
footer.parent = footerSlot
}
}
Control {
SplitView.minimumWidth: (!!leftPanel) ? 304 : 0
SplitView.preferredWidth: (!!leftPanel) ? 304 : 0
@ -167,7 +178,15 @@ SplitView {
id: centerPanelSlot
width: parent.width
anchors.top: statusToolBar.bottom
anchors.bottom: footerSlot.top
anchors.bottomMargin: footerSlot.visible ? 8 : 0
}
Item {
id: footerSlot
width: parent.width
height: visible ? childrenRect.height : 0
anchors.bottom: parent.bottom
visible: (!!footer)
}
}
}

View File

@ -96,6 +96,7 @@ Item {
rightPanelStackView.replace(cmpSavedAddresses)
else
rightPanelStackView.replace(walletContainer)
RootStore.backButtonName = ""
}
emojiPopup: root.emojiPopup
networkConnectionStore: root.networkConnectionStore
@ -114,5 +115,12 @@ Item {
NumberAnimation { property: "opacity"; from: 1; to: 0; duration: 400; easing.type: Easing.OutCubic }
}
}
footer: WalletFooter {
sendModal: root.sendModalPopup
width: parent.width
walletStore: RootStore
networkConnectionStore: root.networkConnectionStore
}
}
}

View File

@ -42,112 +42,97 @@ Item {
}
}
ColumnLayout {
StackLayout {
id: stack
anchors.fill: parent
StackLayout {
id: stack
Layout.fillWidth: true
Layout.preferredHeight: parent.height - footer.height
onCurrentIndexChanged: {
RootStore.backButtonName = d.getBackButtonText(currentIndex)
}
ColumnLayout {
WalletHeader {
Layout.fillWidth: true
overview: RootStore.overview
store: root.store
walletStore: RootStore
networkConnectionStore: root.networkConnectionStore
}
StatusTabBar {
id: walletTabBar
objectName: "rightSideWalletTabBar"
horizontalPadding: Style.current.padding
Layout.fillWidth: true
Layout.topMargin: Style.current.padding
StatusTabButton {
leftPadding: 0
width: implicitWidth
text: qsTr("Assets")
}
StatusTabButton {
width: implicitWidth
text: qsTr("Collectibles")
}
StatusTabButton {
rightPadding: 0
width: implicitWidth
text: qsTr("Activity")
}
}
StackLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: Style.current.padding
Layout.bottomMargin: Style.current.padding
currentIndex: walletTabBar.currentIndex
AssetsView {
account: RootStore.currentAccount
networkConnectionStore: root.networkConnectionStore
assetDetailsLaunched: stack.currentIndex === 2
onAssetClicked: {
assetDetailView.token = token
stack.currentIndex = 2
}
}
CollectiblesView {
collectiblesModel: RootStore.flatCollectibles
onCollectibleClicked: {
RootStore.selectCollectible(address, tokenId)
stack.currentIndex = 1
}
}
HistoryView {
assets: RootStore.assets
onLaunchTransactionDetail: {
transactionDetailView.transaction = transaction
stack.currentIndex = 3
}
}
}
}
CollectibleDetailView {
Layout.fillWidth: true
Layout.fillHeight: true
}
AssetsDetailView {
id: assetDetailView
Layout.fillWidth: true
Layout.fillHeight: true
visible: (stack.currentIndex === 2)
account: RootStore.currentAccount
address: RootStore.currentAccount.address
networkConnectionStore: root.networkConnectionStore
}
TransactionDetailView {
id: transactionDetailView
Layout.fillWidth: true
Layout.fillHeight: true
sendModal: root.sendModal
contactsStore: root.contactsStore
visible: (stack.currentIndex === 3)
}
onCurrentIndexChanged: {
RootStore.backButtonName = d.getBackButtonText(currentIndex)
}
WalletFooter {
id: footer
ColumnLayout {
WalletHeader {
Layout.fillWidth: true
overview: RootStore.overview
store: root.store
walletStore: RootStore
networkConnectionStore: root.networkConnectionStore
}
StatusTabBar {
id: walletTabBar
objectName: "rightSideWalletTabBar"
horizontalPadding: Style.current.padding
Layout.fillWidth: true
Layout.topMargin: Style.current.padding
StatusTabButton {
leftPadding: 0
width: implicitWidth
text: qsTr("Assets")
}
StatusTabButton {
width: implicitWidth
text: qsTr("Collectibles")
}
StatusTabButton {
rightPadding: 0
width: implicitWidth
text: qsTr("Activity")
}
}
StackLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: Style.current.padding
Layout.bottomMargin: Style.current.padding
currentIndex: walletTabBar.currentIndex
AssetsView {
account: RootStore.currentAccount
networkConnectionStore: root.networkConnectionStore
assetDetailsLaunched: stack.currentIndex === 2
onAssetClicked: {
assetDetailView.token = token
stack.currentIndex = 2
}
}
CollectiblesView {
collectiblesModel: RootStore.flatCollectibles
onCollectibleClicked: {
RootStore.selectCollectible(address, tokenId)
stack.currentIndex = 1
}
}
HistoryView {
assets: RootStore.assets
onLaunchTransactionDetail: {
transactionDetailView.transaction = transaction
stack.currentIndex = 3
}
}
}
}
CollectibleDetailView {
Layout.fillWidth: true
Layout.leftMargin: !!root.StackView ? -root.StackView.view.anchors.leftMargin : 0
Layout.rightMargin: !!root.StackView ? -root.StackView.view.anchors.rightMargin : 0
sendModal: root.sendModal
walletStore: RootStore
Layout.fillHeight: true
}
AssetsDetailView {
id: assetDetailView
Layout.fillWidth: true
Layout.fillHeight: true
visible: (stack.currentIndex === 2)
account: RootStore.currentAccount
address: RootStore.currentAccount.address
networkConnectionStore: root.networkConnectionStore
}
TransactionDetailView {
id: transactionDetailView
Layout.fillWidth: true
Layout.fillHeight: true
sendModal: root.sendModal
contactsStore: root.contactsStore
visible: (stack.currentIndex === 3)
}
}
}

View File

@ -1,5 +1,6 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
@ -100,23 +101,20 @@ Item {
StatusListView {
id: listView
objectName: "SavedAddressesView_savedAddresses"
anchors.top: errorMessage.bottom
anchors.top: header.bottom
anchors.topMargin: Style.current.padding
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.current.halfPadding
anchors.right: parent.right
anchors.left: parent.left
visible: listView.count > 0
spacing: 5
visible: count > 0
model: SortFilterProxyModel {
sourceModel: RootStore.savedAddresses
sorters: RoleSorter { roleName: "createdAt"; sortOrder: Qt.DescendingOrder }
}
delegate: SavedAddressesDelegate {
id: savedAddressDelegate
objectName: "savedAddressView_Delegate_" + name
name: model.name
address: model.address
chainShortNames: model.chainShortNames