refactor(ProfileLayout): make use of StatusQ layout components

Closes #2716
This commit is contained in:
Pascal Precht 2021-06-16 13:15:28 +02:00 committed by Pascal Precht
parent 88ca3b9bbf
commit aa4bdaf910
1 changed files with 16 additions and 29 deletions

View File

@ -5,45 +5,28 @@ import "../../../imports"
import "../../../shared"
import "./Sections"
SplitView {
import StatusQ.Layout 0.1
StatusAppTwoPanelLayout {
id: profileView
property int contentMaxWidth: 624
property int contentMinWidth: 450
property int topMargin: 46
property alias changeProfileSection: leftTab.changeProfileSection
id: profileView
Layout.fillHeight: true
Layout.fillWidth: true
handle: SplitViewHandle {}
Connections {
target: appMain
onSettingsLoaded: {
// Add recent
profileView.restoreState(appSettings.profileSplitView)
}
}
Component.onDestruction: appSettings.profileSplitView = this.saveState()
LeftTab {
leftPanel: LeftTab {
id: leftTab
SplitView.preferredWidth: Style.current.leftTabPreferredSize
anchors.fill:parent
}
StackLayout {
property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth))
rightPanel: StackLayout {
id: profileContainer
anchors.top: parent.top
anchors.topMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
currentIndex: leftTab.currentTab
property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth))
anchors.fill: parent
// This list needs to match LeftTab/constants.js
// Would be better if we could make them match automatically
MyProfileContainer {}
currentIndex: leftTab.currentTab
onCurrentIndexChanged: {
if(visibleChildren[0] === ensContainer){
@ -51,6 +34,10 @@ SplitView {
}
}
// This list needs to match LeftTab/constants.js
// Would be better if we could make them match automatically
MyProfileContainer {}
ContactsContainer {}
EnsContainer {