diff --git a/ui/app/AppLayouts/Profile/ProfileLayout.qml b/ui/app/AppLayouts/Profile/ProfileLayout.qml index f1211b7d09..ad6375eae4 100644 --- a/ui/app/AppLayouts/Profile/ProfileLayout.qml +++ b/ui/app/AppLayouts/Profile/ProfileLayout.qml @@ -12,15 +12,22 @@ import "views" import StatusQ.Layout 0.1 StatusAppTwoPanelLayout { - id: profileView - property RootStore store - property var globalStore - property int contentMaxWidth: 624 - property int contentMinWidth: 450 property alias changeProfileSection: leftTab.changeProfileSection + property RootStore store: RootStore { } + property var globalStore + property var systemPalette + property bool networkGuarded: false + + QtObject { + id: _internal + readonly property int contentMaxWidth: 624 + readonly property int contentMinWidth: 450 + property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth)) + } + leftPanel: LeftTabView { id: leftTab store: profileView.store @@ -29,7 +36,7 @@ StatusAppTwoPanelLayout { rightPanel: StackLayout { id: profileContainer - property int profileContentWidth: Math.max(contentMinWidth, Math.min(profileContainer.width * 0.8, contentMaxWidth)) + anchors.fill: parent currentIndex: Global.currentMenuTab @@ -42,39 +49,51 @@ StatusAppTwoPanelLayout { MyProfileView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } ContactsView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } EnsView { id: ensContainer store: profileView.store messageStore: profileView.globalStore.messageStore + networkGuarded: profileView.networkGuarded + profileContentWidth: _internal.profileContentWidth } PrivacyView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } AppearanceView { store: profileView.store globalStore: profileView.globalStore + profileContentWidth: _internal.profileContentWidth + systemPalette: profileView.systemPalette } - SoundsView {} + SoundsView { + profileContentWidth: _internal.profileContentWidth + } LanguageView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } NotificationsView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } SyncView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } DevicesView { @@ -83,16 +102,21 @@ StatusAppTwoPanelLayout { BrowserView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } AdvancedView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } - HelpView {} + HelpView { + profileContentWidth: _internal.profileContentWidth + } AboutView { store: profileView.store + profileContentWidth: _internal.profileContentWidth } } } diff --git a/ui/app/AppLayouts/Profile/popups/ChatLinksPreviewModal.qml b/ui/app/AppLayouts/Profile/popups/ChatLinksPreviewModal.qml index 0277cea554..849f452d9f 100644 --- a/ui/app/AppLayouts/Profile/popups/ChatLinksPreviewModal.qml +++ b/ui/app/AppLayouts/Profile/popups/ChatLinksPreviewModal.qml @@ -1,15 +1,16 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 -import utils 1.0 +import StatusQ.Controls 0.1 +import StatusQ.Core 0.1 +import StatusQ.Core.Theme 0.1 -import StatusQ.Controls 0.1 as StatusQControls - -import shared 1.0 import shared.panels 1.0 import shared.popups 1.0 import shared.status 1.0 +import utils 1.0 + // TODO: replace with StatusModal ModalPopup { id: popup @@ -45,7 +46,7 @@ ModalPopup { text: qsTrId("websites") width: parent.width - StatusQControls.StatusFlatButton { + StatusFlatButton { //% "Enable all" text: qsTrId("enable-all") anchors.right: parent.right @@ -64,7 +65,7 @@ ModalPopup { } Connections { - target: appMain + target: Global onSettingsLoaded: { popup.populatePreviewableSites() } @@ -149,9 +150,10 @@ ModalPopup { } } - StyledText { + StatusBaseText { id: siteTitle text: title + color: Theme.palette.directColor1 font.pixelSize: 15 font.weight: Font.Medium anchors.top: thumbnail.top @@ -159,7 +161,7 @@ ModalPopup { anchors.leftMargin: Style.current.padding } - StyledText { + StatusBaseText { text: address font.pixelSize: 15 font.weight: Font.Thin @@ -168,7 +170,7 @@ ModalPopup { anchors.left: siteTitle.left } - StatusQControls.StatusSwitch { + StatusSwitch { id: settingSwitch checked: !!isWhitelisted anchors.verticalCenter: parent.verticalCenter @@ -203,7 +205,7 @@ ModalPopup { } } - StyledText { + StatusBaseText { id: infoText //% "Previewing links from these websites may share your metadata with their owners." text: qsTrId("previewing-links-from-these-websites-may-share-your-metadata-with-their-owners-") @@ -216,9 +218,3 @@ ModalPopup { } } } - -/*##^## -Designer { - D{i:0;autoSize:true;height:480;width:640} -} -##^##*/ diff --git a/ui/app/AppLayouts/Profile/popups/DappList.qml b/ui/app/AppLayouts/Profile/popups/DappList.qml index dada4809e4..1fe896b961 100644 --- a/ui/app/AppLayouts/Profile/popups/DappList.qml +++ b/ui/app/AppLayouts/Profile/popups/DappList.qml @@ -44,15 +44,9 @@ ModalPopup { model: root.store.dappList delegate: Dapp { name: model.name - onDappClicked: permissionListPopup.createObject(appMain, {dapp: dapp}).open() + onDappClicked: Global.openPopup(permissionListPopup, {dapp: dapp}) } } } } } - -/*##^## -Designer { - D{i:0;height:300;width:300} -} -##^##*/ diff --git a/ui/app/AppLayouts/Profile/popups/PermissionList.qml b/ui/app/AppLayouts/Profile/popups/PermissionList.qml index b770b24e98..fb8dcfaa5e 100644 --- a/ui/app/AppLayouts/Profile/popups/PermissionList.qml +++ b/ui/app/AppLayouts/Profile/popups/PermissionList.qml @@ -2,15 +2,12 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 import QtQuick.Layouts 1.13 -import StatusQ.Core 0.1 -import StatusQ.Core.Theme 0.1 import StatusQ.Controls 0.1 -import utils 1.0 -import shared 1.0 import shared.popups 1.0 -import "./" +import utils 1.0 + import "../panels" // TODO: replace with StatusModal @@ -63,7 +60,7 @@ ModalPopup { footer: StatusButton { anchors.horizontalCenter: parent.horizontalCenter - type: StatusBaseButton.type.Danger + type: StatusBaseButton.Type.Danger //% "Revoke all access" text: qsTrId("revoke-all-access") onClicked: { @@ -73,9 +70,3 @@ ModalPopup { } } } - -/*##^## -Designer { - D{i:0;height:300;width:300} -} -##^##*/ diff --git a/ui/app/AppLayouts/Profile/popups/StoreToKeychainSelectionModal.qml b/ui/app/AppLayouts/Profile/popups/StoreToKeychainSelectionModal.qml index cc1a13d1a7..51e2ae70ca 100644 --- a/ui/app/AppLayouts/Profile/popups/StoreToKeychainSelectionModal.qml +++ b/ui/app/AppLayouts/Profile/popups/StoreToKeychainSelectionModal.qml @@ -6,6 +6,8 @@ import utils 1.0 import shared.popups 1.0 import shared.controls 1.0 +import "../../Onboarding/shared" as OnboardingComponents + // TODO: replace with StatusModal ModalPopup { id: popup @@ -89,5 +91,13 @@ ModalPopup { } } } + + Component { + id: storePasswordModal + OnboardingComponents.CreatePasswordModal { + storingPasswordModal: true + height: 350 + } + } } } diff --git a/ui/app/AppLayouts/Profile/views/AboutView.qml b/ui/app/AppLayouts/Profile/views/AboutView.qml index a5a8c02a3f..1ae6b4e30e 100644 --- a/ui/app/AppLayouts/Profile/views/AboutView.qml +++ b/ui/app/AppLayouts/Profile/views/AboutView.qml @@ -16,13 +16,14 @@ Item { clip: true property var store + property int profileContentWidth Column { id: generalColumn spacing: Style.current.bigPadding anchors.top: parent.top anchors.topMargin: 46 - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter // TODO: replace with StatusListItem @@ -59,7 +60,7 @@ Item { } onClicked: { root.store.checkForUpdates(); - Global.openPopup(downloadModalComponent, {newVersionAvailable: newVersionJSON.available, downloadURL: newVersionJSON.url}) + Global.openDownloadModal() } } } @@ -87,9 +88,3 @@ Item { } } } - -/*##^## -Designer { - D{i:0;height:600;width:800} -} -##^##*/ diff --git a/ui/app/AppLayouts/Profile/views/AdvancedView.qml b/ui/app/AppLayouts/Profile/views/AdvancedView.qml index f6c037d0ff..cf5526700d 100644 --- a/ui/app/AppLayouts/Profile/views/AdvancedView.qml +++ b/ui/app/AppLayouts/Profile/views/AdvancedView.qml @@ -15,17 +15,19 @@ import "../panels" ScrollView { id: root + + property bool isWakuV2: store.fleet == Constants.waku_prod || store.fleet === Constants.waku_test + property var store + property int profileContentWidth + height: parent.height width: parent.width contentHeight: advancedContainer.height + 100 clip: true - property bool isWakuV2: store.fleet == Constants.waku_prod || store.fleet === Constants.waku_test - - property var store Item { id: advancedContainer - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter height: generalColumn.height @@ -524,9 +526,3 @@ ScrollView { } } } - -/*##^## -Designer { - D{i:0;height:400;width:700} -} -##^##*/ diff --git a/ui/app/AppLayouts/Profile/views/AppearanceView.qml b/ui/app/AppLayouts/Profile/views/AppearanceView.qml index 073fb42bcd..7d12c571c6 100644 --- a/ui/app/AppLayouts/Profile/views/AppearanceView.qml +++ b/ui/app/AppLayouts/Profile/views/AppearanceView.qml @@ -16,13 +16,12 @@ import StatusQ.Controls 0.1 as StatusQ import "../popups" ScrollView { - height: parent.height - width: parent.width - id: root - contentHeight: appearanceContainer.height - clip: true + id: appearanceView + + property var systemPalette property var store property var globalStore + property int profileContentWidth enum Theme { Light, @@ -39,9 +38,14 @@ ScrollView { Style.changeFontSize(fontSize) } + height: parent.height + width: parent.width + contentHeight: appearanceContainer.height + clip: true + Item { id: appearanceContainer - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter height: this.childrenRect.height + 100 @@ -82,8 +86,8 @@ ScrollView { anchors.topMargin: Style.current.padding*2 anchors.left: parent.left anchors.leftMargin: Style.current.smallPadding -// rootStore: root.rootStore -// messageStore: root.globalStore.messageStore +// rootStore: appearanceView.rootStore +// messageStore: appearanceView.globalStore.messageStore ///////////TODO Remove // userName: "@vitalik" // identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAb0lEQVR4Ae3UQQqAIBRF0Wj9ba9Bq6l5JBQqfn/ngDMH3YS3AAB/tO3H+XRG3b9bR/+gVoREI2RapVXpfd5+X5oXERKNkHS+rk3tOpWkeREh0QiZVu91ql2zNC8iJBoh0yqtSqt1slpCghICANDPBc0ESPh0bHkHAAAAAElFTkSuQmCC" @@ -135,7 +139,7 @@ ScrollView { value: localAccountSensitiveSettings.fontSize onValueChanged: { localAccountSensitiveSettings.fontSize = value - root.updateFontSize(value) + appearanceView.updateFontSize(value) } RowLayout { @@ -214,7 +218,7 @@ ScrollView { StatusQ.StatusSlider { id: zoomSlider readonly property int initialValue: { - let scaleFactorStr = root.store.readTextFile(uiScaleFilePath) + let scaleFactorStr = appearanceView.store.readTextFile(uiScaleFilePath) if (scaleFactorStr === "") { return 100 } @@ -234,7 +238,7 @@ ScrollView { value: initialValue onValueChanged: { if (value !== initialValue) { - root.store.writeTextFile(uiScaleFilePath, value / 100.0) + appearanceView.store.writeTextFile(uiScaleFilePath, value / 100.0) } } onPressedChanged: { @@ -328,7 +332,7 @@ ScrollView { control.checked: localAppSettings.theme === Universal.Light onRadioCheckedChanged: { if (checked) { - root.updateTheme(Universal.Light) + appearanceView.updateTheme(Universal.Light) } } } @@ -344,7 +348,7 @@ ScrollView { control.checked: localAppSettings.theme === Universal.Dark onRadioCheckedChanged: { if (checked) { - root.updateTheme(Universal.Dark) + appearanceView.updateTheme(Universal.Dark) } } } @@ -360,7 +364,7 @@ ScrollView { control.checked: localAppSettings.theme === Universal.System onRadioCheckedChanged: { if (checked) { - root.updateTheme(Universal.System) + appearanceView.updateTheme(Universal.System) } } } diff --git a/ui/app/AppLayouts/Profile/views/BrowserView.qml b/ui/app/AppLayouts/Profile/views/BrowserView.qml index b3eef3933c..925014d19b 100644 --- a/ui/app/AppLayouts/Profile/views/BrowserView.qml +++ b/ui/app/AppLayouts/Profile/views/BrowserView.qml @@ -20,6 +20,7 @@ Item { clip: true property var store + property int profileContentWidth property Component dappListPopup: DappList { store: root.store @@ -33,7 +34,7 @@ Item { anchors.top: parent.top anchors.topMargin: 64 anchors.bottom: parent.bottom - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter @@ -139,9 +140,3 @@ Item { } } } - -/*##^## -Designer { - D{i:0;height:400;width:700} -} -##^##*/ diff --git a/ui/app/AppLayouts/Profile/views/ContactsView.qml b/ui/app/AppLayouts/Profile/views/ContactsView.qml index d7f8872f15..957699de4c 100644 --- a/ui/app/AppLayouts/Profile/views/ContactsView.qml +++ b/ui/app/AppLayouts/Profile/views/ContactsView.qml @@ -20,6 +20,7 @@ Item { id: root property var store + property int profileContentWidth property alias searchStr: searchBox.text property bool isPending: false @@ -31,7 +32,7 @@ Item { anchors.top: parent.top anchors.topMargin: 32 anchors.bottom: parent.bottom - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppLayouts/Profile/views/EnsListView.qml b/ui/app/AppLayouts/Profile/views/EnsListView.qml index 178245d107..0aa24d3093 100644 --- a/ui/app/AppLayouts/Profile/views/EnsListView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsListView.qml @@ -21,6 +21,7 @@ Item { signal selectEns(string username) property var store + property int profileContentWidth // Defaults to show message property bool isMessage: true @@ -45,7 +46,7 @@ Item { Item { anchors.top: parent.top - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter Component { diff --git a/ui/app/AppLayouts/Profile/views/EnsSearchView.qml b/ui/app/AppLayouts/Profile/views/EnsSearchView.qml index a72b0f5956..1dfcffb713 100644 --- a/ui/app/AppLayouts/Profile/views/EnsSearchView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsSearchView.qml @@ -16,6 +16,7 @@ Item { id: root property var store + property int profileContentWidth signal continueClicked(string output, string username) signal usernameUpdated(username: string); @@ -89,7 +90,7 @@ Item { Item { id: ensContainer anchors.top: parent.top - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter Rectangle { diff --git a/ui/app/AppLayouts/Profile/views/EnsView.qml b/ui/app/AppLayouts/Profile/views/EnsView.qml index 36ba231c69..950a845e1b 100644 --- a/ui/app/AppLayouts/Profile/views/EnsView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsView.qml @@ -5,43 +5,40 @@ import QtQml.StateMachine 1.14 as DSM import utils 1.0 import shared 1.0 -/* import "./Ens" */ import "../stores" -import "." Item { - id: root - - Layout.fillHeight: true - Layout.fillWidth: true - clip: true + id: ensView property var store - + property var messageStore + property bool networkGuarded: false + property int profileContentWidth property bool showSearchScreen: false property string addedUsername: "" property string selectedUsername: "" - property var messageStore signal next(output: string) signal back() signal done(ensUsername: string) signal connect(ensUsername: string) signal changePubKey(ensUsername: string) - - signal goToWelcome(); signal goToList(); function goToStart(){ - if(root.store.ens.rowCount() > 0 && networkGuarded){ + if(ensView.store.ens.rowCount() > 0 && networkGuarded){ goToList(); } else { goToWelcome(); } } + Layout.fillHeight: true + Layout.fillWidth: true + clip: true + DSM.StateMachine { id: stateMachine initialState: welcomeState @@ -215,15 +212,18 @@ Item { Component { id: welcome EnsWelcomeView { - username: root.store.username + username: ensView.store.username onStartBtnClicked: next(null) + networkGuarded: ensView.networkGuarded + profileContentWidth: ensView.profileContentWidth } } Component { id: search EnsSearchView { - store: root.store + store: ensView.store + profileContentWidth: ensView.profileContentWidth onContinueClicked: { if(output === "connected"){ connect(username) @@ -242,7 +242,7 @@ Item { Component { id: termsAndConditions EnsTermsAndConditionsView { - store: root.store + store: ensView.store username: selectedUsername onBackBtnClicked: back(); onUsernameRegistered: done(userName); @@ -283,11 +283,12 @@ Item { Component { id: list EnsListView { - store: root.store - messageStore: ensContainer.messageStore + store: ensView.store + messageStore: ensView.messageStore + profileContentWidth: ensView.profileContentWidth onAddBtnClicked: next("search") onSelectEns: { - root.store.ensDetails(username) + ensView.store.ensDetails(username) selectedUsername = username; next("details") } @@ -297,7 +298,7 @@ Item { Component { id: details EnsDetailsView { - store: root.store + store: ensView.store username: selectedUsername onBackBtnClicked: back(); onUsernameReleased: { @@ -308,21 +309,21 @@ Item { } Connections { - target: root + target: ensView onConnect: { addedUsername = ensUsername; } } Connections { - target: root.store.ens + target: ensView.store.ens onTransactionWasSent: { //% "Transaction pending..." toastMessage.title = qsTrId("ens-transaction-pending") toastMessage.source = Style.svg("loading") toastMessage.iconColor = Style.current.primary toastMessage.iconRotates = true - toastMessage.link = `${root.store.etherscanLink}/${txResult}` + toastMessage.link = `${ensView.store.etherscanLink}/${txResult}` toastMessage.open() } onTransactionCompleted: { @@ -353,7 +354,7 @@ Item { toastMessage.iconColor = Style.current.danger } - toastMessage.link = `${root.store.etherscanLink}/${txHash}` + toastMessage.link = `${ensView.store.etherscanLink}/${txHash}` toastMessage.open() } } diff --git a/ui/app/AppLayouts/Profile/views/EnsWelcomeView.qml b/ui/app/AppLayouts/Profile/views/EnsWelcomeView.qml index a41100f08e..ad0fbf1b81 100644 --- a/ui/app/AppLayouts/Profile/views/EnsWelcomeView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsWelcomeView.qml @@ -10,9 +10,12 @@ import utils 1.0 Item { id: root + signal startBtnClicked() property string username: "" + property int profileContentWidth + property bool networkGuarded: false ScrollView { id: sview @@ -28,7 +31,7 @@ Item { Item { id: contentItem - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter Image { diff --git a/ui/app/AppLayouts/Profile/views/HelpView.qml b/ui/app/AppLayouts/Profile/views/HelpView.qml index 633b359e04..0c8c2fd27c 100644 --- a/ui/app/AppLayouts/Profile/views/HelpView.qml +++ b/ui/app/AppLayouts/Profile/views/HelpView.qml @@ -14,6 +14,9 @@ import "../panels" Item { id: helpContainer + + property int profileContentWidth + height: parent.height Layout.fillWidth: true clip: true @@ -27,7 +30,7 @@ Item { id: glossary anchors.top: parent.top height: this.childrenRect.height - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter @@ -134,7 +137,7 @@ Item { anchors.top: glossary.bottom anchors.topMargin: Style.current.bigPadding * 2 height: this.childrenRect.height - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppLayouts/Profile/views/LanguageView.qml b/ui/app/AppLayouts/Profile/views/LanguageView.qml index 5326480ac6..1dcb548f56 100644 --- a/ui/app/AppLayouts/Profile/views/LanguageView.qml +++ b/ui/app/AppLayouts/Profile/views/LanguageView.qml @@ -17,6 +17,7 @@ Item { clip: true property var store + property int profileContentWidth property Component languagePopup: LanguageModal { store: languageContainer.store } @@ -25,7 +26,7 @@ Item { anchors.top: parent.top anchors.topMargin: 64 anchors.bottom: parent.bottom - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppLayouts/Profile/views/MyProfileView.qml b/ui/app/AppLayouts/Profile/views/MyProfileView.qml index a1a4b98a61..f20eca9e3d 100644 --- a/ui/app/AppLayouts/Profile/views/MyProfileView.qml +++ b/ui/app/AppLayouts/Profile/views/MyProfileView.qml @@ -18,6 +18,7 @@ Item { id: root property var store + property int profileContentWidth property string ensName: store.preferredUsername || store.firstEnsUsername || "" property string username: store.username @@ -45,7 +46,7 @@ Item { id: profileImgNameContainer anchors.top: parent.top anchors.topMargin: 64 - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppLayouts/Profile/views/NotificationsView.qml b/ui/app/AppLayouts/Profile/views/NotificationsView.qml index 1aa810ee67..44afbc003c 100644 --- a/ui/app/AppLayouts/Profile/views/NotificationsView.qml +++ b/ui/app/AppLayouts/Profile/views/NotificationsView.qml @@ -18,16 +18,18 @@ import "./" ScrollView { id: root + + property var store + property int profileContentWidth + height: parent.height width: parent.width contentHeight: notificationsContainer.height clip: true - property var store - Item { id: notificationsContainer - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter height: this.childrenRect.height + 100 diff --git a/ui/app/AppLayouts/Profile/views/PrivacyView.qml b/ui/app/AppLayouts/Profile/views/PrivacyView.qml index 470aa1b839..98bb5118a6 100644 --- a/ui/app/AppLayouts/Profile/views/PrivacyView.qml +++ b/ui/app/AppLayouts/Profile/views/PrivacyView.qml @@ -6,7 +6,6 @@ import QtGraphicalEffects 1.13 import utils 1.0 import shared.panels 1.0 import shared.status 1.0 -import "../../Onboarding/shared" as OnboardingComponents import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 @@ -22,12 +21,13 @@ Item { clip: true property var store + property int profileContentWidth Column { id: containerColumn anchors.top: parent.top anchors.topMargin: 64 - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter @@ -107,14 +107,6 @@ Item { ] sensor.onClicked: Global.openPopup(storeToKeychainSelectionModal) - Component { - id: storePasswordModal - OnboardingComponents.CreatePasswordModal { - storingPasswordModal: true - height: 350 - } - } - Component { id: storeToKeychainSelectionModal StoreToKeychainSelectionModal {} @@ -128,8 +120,7 @@ Item { ChangePasswordModal { id: changePasswordModal anchors.centerIn: parent - - onPasswordChanged: successPopup.open() + successPopup: successPopup } ChangePasswordSuccessModal { @@ -167,15 +158,10 @@ Item { StatusQControls.StatusSwitch { id: switch1 checked: !localAccountSensitiveSettings.onlyShowContactsProfilePics - onCheckedChanged: { - if (localAccountSensitiveSettings.onlyShowContactsProfilePics !== !checked) { - localAccountSensitiveSettings.onlyShowContactsProfilePics = !checked - } - } } ] sensor.onClicked: { - switch1.checked = !switch1.checked + switch1.checked = localAccountSensitiveSettings.onlyShowContactsProfilePics = !switch1.checked } } @@ -189,17 +175,12 @@ Item { implicitHeight: 52 components: [ StatusQControls.StatusSwitch { - id: switch2 + id: switch2 checked: localAccountSensitiveSettings.displayChatImages - onCheckedChanged: { - if (localAccountSensitiveSettings.displayChatImages !== checked) { - localAccountSensitiveSettings.displayChatImages !== checked - } - } } ] sensor.onClicked: { - switch2.checked = !switch2.checked + switch2.checked = localAccountSensitiveSettings.displayChatImages = !switch2.checked } } @@ -274,22 +255,11 @@ Item { StatusQControls.StatusSwitch { id: switch3 checked: !root.store.messagesFromContactsOnly - onCheckedChanged: { - if (root.store.messagesFromContactsOnly !== !checked) { - root.store.messagesFromContactsOnly = !checked - } - } } ] sensor.onClicked: { - switch3.checked = !switch3.checked + root.store.setMessagesFromContactsOnly(!switch3.checked) } } } } - -/*##^## -Designer { - D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640} -} -##^##*/ diff --git a/ui/app/AppLayouts/Profile/views/SoundsView.qml b/ui/app/AppLayouts/Profile/views/SoundsView.qml index 2263e369c7..040e3cb7ea 100644 --- a/ui/app/AppLayouts/Profile/views/SoundsView.qml +++ b/ui/app/AppLayouts/Profile/views/SoundsView.qml @@ -10,12 +10,16 @@ import StatusQ.Controls 0.1 Item { id: soundsContainer + + property var store + property int profileContentWidth + Layout.fillHeight: true Layout.fillWidth: true clip: true Item { - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppLayouts/Profile/views/SyncView.qml b/ui/app/AppLayouts/Profile/views/SyncView.qml index c8134521e5..01ddb2690d 100644 --- a/ui/app/AppLayouts/Profile/views/SyncView.qml +++ b/ui/app/AppLayouts/Profile/views/SyncView.qml @@ -13,10 +13,13 @@ import shared.controls 1.0 Item { id: root - Layout.fillHeight: true - Layout.fillWidth: true + property var store property string activeMailserver: "" + property int profileContentWidth + + Layout.fillHeight: true + Layout.fillWidth: true Connections { target: root.store.mailservers @@ -27,7 +30,7 @@ Item { } Item { - width: profileContainer.profileContentWidth + width: profileContentWidth anchors.top: parent.top anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 65d61ea79c..4c5dc0d09a 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -32,6 +32,8 @@ Item { anchors.fill: parent property alias appLayout: appLayout + // set from main.qml + property var sysPalette // Not Refactored Yet property var newVersionJSON: "" //JSON.parse(utilsModel.newVersion) property bool profilePopupOpened: false @@ -39,7 +41,6 @@ Item { // property bool networkGuarded: profileModel.network.current === Constants.networkMainnet || (profileModel.network.current === Constants.networkRopsten && localAccountSensitiveSettings.stickersEnsRopsten) property RootStore rootStore: RootStore { } - signal settingsLoaded() signal openContactsPopup() Connections { @@ -55,6 +56,11 @@ Item { popup.open(); return popup; } + onOpenDownloadModalRequested: { + const popup = downloadModalComponent.createObject(appMain, {newVersionAvailable: newVersionJSON.available, downloadURL: newVersionJSON.url}) + popup.open() + return popup + } } function changeAppSectionBySectionId(sectionId) { @@ -170,7 +176,7 @@ Item { text: qsTr("A new version of Status (%1) is available").arg(newVersionJSON.version) btnText: qsTr("Download") onClick: function(){ - Global.openPopup(downloadModalComponent, {newVersionAvailable: newVersionJSON.available, downloadURL: newVersionJSON.url}) + Global.openDownloadModal() } } @@ -467,6 +473,8 @@ Item { Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.fillHeight: true globalStore: appMain.rootStore + systemPalette: appMain.sysPalette + networkGuarded: appMain.networkGuarded } NodeLayout { @@ -815,6 +823,6 @@ Item { // } catch (e) { // console.error('Could not parse the whitelist for sites', e) // } - appMain.settingsLoaded() + Global.settingsHasLoaded() } } diff --git a/ui/imports/shared/status/StatusEmojiPopup.qml b/ui/imports/shared/status/StatusEmojiPopup.qml index 220726ff8b..e169a14573 100644 --- a/ui/imports/shared/status/StatusEmojiPopup.qml +++ b/ui/imports/shared/status/StatusEmojiPopup.qml @@ -182,7 +182,7 @@ Popup { Connections { id: connectionSettings - target: appMain + target: Global onSettingsLoaded: { connectionSettings.enabled = false // Add recent diff --git a/ui/imports/utils/Global.qml b/ui/imports/utils/Global.qml index ead6d34550..8beb0dcd09 100644 --- a/ui/imports/utils/Global.qml +++ b/ui/imports/utils/Global.qml @@ -14,6 +14,12 @@ QtObject { signal openLinkInBrowser(string link) signal openChooseBrowserPopup(string link) signal openPopupRequested(var popupComponent, var params) + signal openDownloadModalRequested() + signal settingsLoaded() + + function openDownloadModal(){ + openDownloadModalRequested() + } function openPopup(popupComponent, params = {}) { root.openPopupRequested(popupComponent, params); @@ -39,4 +45,8 @@ QtObject { function playErrorSound() { errorSound.play(); } + + function settingsHasLoaded() { + settingsLoaded() + } } diff --git a/ui/main.qml b/ui/main.qml index 50371d6191..01ae217c60 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -504,7 +504,9 @@ StatusWindow { Component { id: app - AppMain {} + AppMain { + sysPalette: systemPalette + } } Component {