refactor(WalletLayout): use StatusQ two panel layout

This commit is contained in:
Pascal Precht 2021-06-11 15:57:43 +02:00 committed by Pascal Precht
parent 8d48ebf864
commit 88ca3b9bbf
2 changed files with 38 additions and 48 deletions

View File

@ -11,7 +11,6 @@ Rectangle {
id: root
visible: !profileModel.mnemonic.isBackedUp
height: visible ? 32 : 0
Layout.fillWidth: true
color: Style.current.red
Row {
@ -90,4 +89,4 @@ Rectangle {
id: backupSeedModal
}
}
}

View File

@ -5,68 +5,59 @@ import "../../../imports"
import "../../../shared"
import "."
ColumnLayout {
import StatusQ.Layout 0.1
Item {
id: walletView
property bool hideSignPhraseModal: false
SignPhraseModal {
id: signPhrasePopup
}
function showSigningPhrasePopup(){
if(!hideSignPhraseModal && !appSettings.hideSignPhraseModal){
signPhrasePopup.open();
}
}
Component.onCompleted: {
if(onboardingModel.firstTimeLogin){
onboardingModel.firstTimeLogin = false
walletModel.setInitialRange()
}
walletModel.transactionsView.checkRecentHistory()
SignPhraseModal {
id: signPhrasePopup
}
SeedPhraseBackupWarning {
id: seedPhraseWarning
width: parent.width
anchors.top: parent.top
}
Timer {
id: recentHistoryTimer
interval: Constants.walletFetchRecentHistoryInterval
running: true
repeat: true
onTriggered: walletModel.transactionsView.checkRecentHistory()
}
SeedPhraseBackupWarning { }
SplitView {
id: walletView
Layout.fillHeight: true
Layout.fillWidth: true
StatusAppTwoPanelLayout {
anchors.top: seedPhraseWarning.bottom
height: walletView.height - seedPhraseWarning.height
width: walletView.width
handle: SplitViewHandle {}
Connections {
target: appMain
onSettingsLoaded: {
// Add recent
walletView.restoreState(appSettings.walletSplitView)
Component.onCompleted: {
if(onboardingModel.firstTimeLogin){
onboardingModel.firstTimeLogin = false
walletModel.setInitialRange()
}
}
Component.onDestruction: appSettings.walletSplitView = this.saveState()
LeftTab {
id: leftTab
SplitView.preferredWidth: Style.current.leftTabPreferredSize
Timer {
id: recentHistoryTimer
interval: Constants.walletFetchRecentHistoryInterval
running: true
repeat: true
onTriggered: walletModel.transactionsView.checkRecentHistory()
}
Item {
leftPanel: LeftTab {
id: leftTab
anchors.fill: parent
}
rightPanel: Item {
anchors.fill: parent
id: walletContainer
anchors.top: parent.top
anchors.topMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: leftTab.right
anchors.leftMargin: 0
WalletHeader {
id: walletHeader
@ -101,7 +92,6 @@ ColumnLayout {
background: Rectangle {
color: Style.current.transparent
}
StatusTabButton {
id: assetBtn
//% "Assets"
@ -120,6 +110,7 @@ ColumnLayout {
anchors.leftMargin: 32
//% "History"
btnText: qsTrId("history")
onClicked: historyTab.checkIfHistoryIsBeingFetched()
}
}