refactor(ProfileLayout): make use of StatusQ layout components
Closes #2716
This commit is contained in:
parent
88ca3b9bbf
commit
aa4bdaf910
|
@ -5,45 +5,28 @@ import "../../../imports"
|
||||||
import "../../../shared"
|
import "../../../shared"
|
||||||
import "./Sections"
|
import "./Sections"
|
||||||
|
|
||||||
SplitView {
|
import StatusQ.Layout 0.1
|
||||||
|
|
||||||
|
StatusAppTwoPanelLayout {
|
||||||
|
|
||||||
|
id: profileView
|
||||||
|
|
||||||
property int contentMaxWidth: 624
|
property int contentMaxWidth: 624
|
||||||
property int contentMinWidth: 450
|
property int contentMinWidth: 450
|
||||||
property int topMargin: 46
|
property int topMargin: 46
|
||||||
property alias changeProfileSection: leftTab.changeProfileSection
|
property alias changeProfileSection: leftTab.changeProfileSection
|
||||||
|
|
||||||
id: profileView
|
leftPanel: LeftTab {
|
||||||
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 {
|
|
||||||
id: leftTab
|
id: leftTab
|
||||||
SplitView.preferredWidth: Style.current.leftTabPreferredSize
|
anchors.fill:parent
|
||||||
}
|
}
|
||||||
|
|
||||||
StackLayout {
|
rightPanel: StackLayout {
|
||||||
property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth))
|
|
||||||
|
|
||||||
id: profileContainer
|
id: profileContainer
|
||||||
anchors.top: parent.top
|
property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth))
|
||||||
anchors.topMargin: 0
|
anchors.fill: parent
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.bottomMargin: 0
|
|
||||||
currentIndex: leftTab.currentTab
|
|
||||||
|
|
||||||
// This list needs to match LeftTab/constants.js
|
currentIndex: leftTab.currentTab
|
||||||
// Would be better if we could make them match automatically
|
|
||||||
MyProfileContainer {}
|
|
||||||
|
|
||||||
onCurrentIndexChanged: {
|
onCurrentIndexChanged: {
|
||||||
if(visibleChildren[0] === ensContainer){
|
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 {}
|
ContactsContainer {}
|
||||||
|
|
||||||
EnsContainer {
|
EnsContainer {
|
||||||
|
|
Loading…
Reference in New Issue