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

View File

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