From ad4d7aecc3c0c0159103654de552abc75ab38fb5 Mon Sep 17 00:00:00 2001
From: Xavier Jouslin de Noray <xavier.jouslindenoray@savoirfairelinux.com>
Date: Tue, 23 May 2023 13:46:52 -0400
Subject: [PATCH] ManageAccountPage: no bug on view when resize the view

Gitlab: #886

Change-Id: Ib3d260271d951a16b63db1ac4a0c3c29a4d87f52
---
 src/app/settingsview/SettingsView.qml         |  2 +-
 .../components/ManageAccountPage.qml          | 22 +++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/app/settingsview/SettingsView.qml b/src/app/settingsview/SettingsView.qml
index 59b94b748..3cc6a12da 100644
--- a/src/app/settingsview/SettingsView.qml
+++ b/src/app/settingsview/SettingsView.qml
@@ -92,7 +92,7 @@ ListSelectionView {
 
         signal stopBooth
 
-        initialItem: ManageAccountPage {}
+        initialItem: viewNode.resources["ManageAccountPage"]
 
         onCurrentIndexChanged: {
             switch (currentIndex) {
diff --git a/src/app/settingsview/components/ManageAccountPage.qml b/src/app/settingsview/components/ManageAccountPage.qml
index 9e5736317..41d1a949b 100644
--- a/src/app/settingsview/components/ManageAccountPage.qml
+++ b/src/app/settingsview/components/ManageAccountPage.qml
@@ -47,14 +47,14 @@ SettingsPageBase {
         ColumnLayout {
             id: enableAccount
 
-            width: parent.width
+            Layout.fillWidth: true
             spacing: JamiTheme.settingsCategorySpacing
 
             Text {
                 id: enableAccountTitle
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: parent.width
+                Layout.fillWidth: true
 
                 text: JamiStrings.enableAccountSettingsTitle
                 color: JamiTheme.textColor
@@ -70,7 +70,7 @@ SettingsPageBase {
                 id: accountEnableSwitch
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: parent.width
+                Layout.fillWidth: true
                 labelText: JamiStrings.enableAccountDescription
 
                 widthOfSwitch: 60
@@ -84,7 +84,7 @@ SettingsPageBase {
         ColumnLayout {
             id: userIdentity
 
-            width: parent.width
+            Layout.fillWidth: true
             spacing: JamiTheme.settingsCategorySpacing
             visible: isSIP
 
@@ -92,7 +92,7 @@ SettingsPageBase {
                 id: userIdentityTitle
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: parent.width
+                Layout.fillWidth: true
 
                 text: JamiStrings.identity
                 color: JamiTheme.textColor
@@ -115,7 +115,7 @@ SettingsPageBase {
         ColumnLayout {
             id: jamiIdentity
 
-            width: parent.width
+            Layout.fillWidth: true
             visible: !isSIP
             spacing: JamiTheme.settingsCategorySpacing
 
@@ -123,7 +123,7 @@ SettingsPageBase {
                 id: jamiIdentityTitle
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: parent.width
+                Layout.fillWidth: true
                 text: JamiStrings.jamiIdentity
                 color: JamiTheme.textColor
                 horizontalAlignment: Text.AlignLeft
@@ -148,7 +148,7 @@ SettingsPageBase {
                 id: jamiIdentifierDescription
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: parent.width
+                Layout.fillWidth: true
 
                 text: JamiStrings.usernameAccountDescription
                 color: JamiTheme.textColor
@@ -165,7 +165,7 @@ SettingsPageBase {
         ColumnLayout {
             id: encryptAccount
 
-            width: parent.width
+            Layout.fillWidth: true
             visible: !isSIP && CurrentAccount.managerUri === ""
             spacing: JamiTheme.settingsCategorySpacing
 
@@ -173,7 +173,7 @@ SettingsPageBase {
                 id: encryptTitle
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: parent.width
+                Layout.fillWidth: true
 
                 text: JamiStrings.encryptTitle
                 color: JamiTheme.textColor
@@ -189,7 +189,7 @@ SettingsPageBase {
                 id: encryptDescription
 
                 Layout.alignment: Qt.AlignLeft
-                Layout.preferredWidth: parent.width
+                Layout.fillWidth: true
 
                 text: JamiStrings.ecryptAccountDescription
                 color: JamiTheme.textColor
-- 
GitLab