From aa4bdaf9108340dbbf7116cd4a9b0c9aa2ea6a5e Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Wed, 16 Jun 2021 13:15:28 +0200 Subject: [PATCH] refactor(ProfileLayout): make use of StatusQ layout components Closes #2716 --- ui/app/AppLayouts/Profile/ProfileLayout.qml | 45 ++++++++------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/ui/app/AppLayouts/Profile/ProfileLayout.qml b/ui/app/AppLayouts/Profile/ProfileLayout.qml index bc0de772b5..ca222c0778 100644 --- a/ui/app/AppLayouts/Profile/ProfileLayout.qml +++ b/ui/app/AppLayouts/Profile/ProfileLayout.qml @@ -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 {