Various ui fixes on wallet

- Show scrollbars in asset list if needed
- Show scrollbars in account list if needed
- Fix margin between assets
- Add symbol to asset amounts
- Stop scrolling at element bounds
This commit is contained in:
Richard Ramos 2020-11-27 09:49:57 -04:00 committed by Iuri Matias
parent dae7f9cd44
commit f88a05e2f5
4 changed files with 57 additions and 35 deletions

View File

@ -1,4 +1,6 @@
import QtQuick 2.13 import QtQuick 2.13
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import "../../../imports" import "../../../imports"
import "../../../shared" import "../../../shared"
@ -48,7 +50,7 @@ Item {
} }
StyledText { StyledText {
id: assetValue id: assetValue
text: value.toUpperCase() text: value.toUpperCase() + " " + symbol
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 0 anchors.rightMargin: 0
font.pixelSize: 15 font.pixelSize: 15
@ -79,13 +81,22 @@ Item {
} }
} }
ListView { ScrollView {
id: assetListView
spacing: Style.current.halfPadding
anchors.fill: parent anchors.fill: parent
// model: exampleModel Layout.fillWidth: true
model: walletModel.assets Layout.fillHeight: true
delegate: assetViewDelegate ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: assetListView.contentHeight > assetListView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
ListView {
id: assetListView
spacing: Style.current.padding * 2
anchors.fill: parent
// model: exampleModel
model: walletModel.assets
delegate: assetViewDelegate
boundsBehavior: Flickable.StopAtBounds
}
} }
} }
/*##^## /*##^##

View File

@ -224,6 +224,7 @@ Item {
height: parent.height - extraButtons.height height: parent.height - extraButtons.height
width: parent.width width: parent.width
clip: true clip: true
boundsBehavior: Flickable.StopAtBounds
model: walletModel.transactions model: walletModel.transactions
delegate: transactionListItemCmp delegate: transactionListItemCmp
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {

View File

@ -152,44 +152,53 @@ Item {
} }
} }
ListView { ScrollView {
id: listView
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.top: walletValueTextContainer.bottom anchors.top: walletValueTextContainer.bottom
anchors.topMargin: Style.current.padding anchors.topMargin: Style.current.padding
spacing: 5
anchors.right: parent.right anchors.right: parent.right
anchors.left: parent.left anchors.left: parent.left
Layout.fillWidth: true
Layout.fillHeight: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: listView.contentHeight > listView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
delegate: walletDelegate ListView {
id: listView
ListModel { spacing: 5
id: exampleWalletModel anchors.fill: parent
ListElement { boundsBehavior: Flickable.StopAtBounds
name: "Status account"
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f" delegate: walletDelegate
balance: "12.00 USD"
iconColor: "#7CDA00" ListModel {
id: exampleWalletModel
ListElement {
name: "Status account"
address: "0xcfc9f08bbcbcb80760e8cb9a3c1232d19662fc6f"
balance: "12.00 USD"
iconColor: "#7CDA00"
}
ListElement {
name: "Test account 1"
address: "0x2Ef1...E0Ba"
balance: "12.00 USD"
iconColor: "#FA6565"
}
ListElement {
name: "Status account"
address: "0x2Ef1...E0Ba"
balance: "12.00 USD"
iconColor: "#7CDA00"
}
} }
ListElement { model: walletModel.accounts
name: "Test account 1" // model: exampleWalletModel
address: "0x2Ef1...E0Ba"
balance: "12.00 USD"
iconColor: "#FA6565"
}
ListElement {
name: "Status account"
address: "0x2Ef1...E0Ba"
balance: "12.00 USD"
iconColor: "#7CDA00"
}
} }
model: walletModel.accounts
// model: exampleWalletModel
} }
} }
/*##^## /*##^##

View File

@ -25,6 +25,7 @@ Item {
id: tokenListView id: tokenListView
model: Currencies {} model: Currencies {}
ScrollBar.vertical: ScrollBar { active: true } ScrollBar.vertical: ScrollBar { active: true }
boundsBehavior: Flickable.StopAtBounds
delegate: Component { delegate: Component {
Item { Item {