feat(SettingsContentBase): Dirty bubble horizontally centered correctly
Manual calculation of bubble postion to be correctly centered due to the usage of `SettingsContentBase` as a centralPanel component that already has a default left margin value.
This commit is contained in:
parent
d12641264a
commit
954b25a54c
|
@ -132,6 +132,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: MyProfileView {
|
sourceComponent: MyProfileView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
walletAssetsStore: root.walletAssetsStore
|
walletAssetsStore: root.walletAssetsStore
|
||||||
currencyStore: root.currencyStore
|
currencyStore: root.currencyStore
|
||||||
|
@ -153,6 +154,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: ChangePasswordView {
|
sourceComponent: ChangePasswordView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
privacyStore: root.store.privacyStore
|
privacyStore: root.store.privacyStore
|
||||||
passwordStrengthScoreFunction: SharedStores.RootStore.getPasswordStrengthScore
|
passwordStrengthScoreFunction: SharedStores.RootStore.getPasswordStrengthScore
|
||||||
contentWidth: d.contentWidth
|
contentWidth: d.contentWidth
|
||||||
|
@ -166,6 +168,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: ContactsView {
|
sourceComponent: ContactsView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
contactsStore: root.store.contactsStore
|
contactsStore: root.store.contactsStore
|
||||||
sectionTitle: qsTr("Contacts")
|
sectionTitle: qsTr("Contacts")
|
||||||
contentWidth: d.contentWidth
|
contentWidth: d.contentWidth
|
||||||
|
@ -198,6 +201,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: MessagingView {
|
sourceComponent: MessagingView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
advancedStore: root.store.advancedStore
|
advancedStore: root.store.advancedStore
|
||||||
messagingStore: root.store.messagingStore
|
messagingStore: root.store.messagingStore
|
||||||
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.messaging)
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.messaging)
|
||||||
|
@ -213,6 +217,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: WalletView {
|
sourceComponent: WalletView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
rootStore: root.store
|
rootStore: root.store
|
||||||
tokensStore: root.tokensStore
|
tokensStore: root.tokensStore
|
||||||
networkConnectionStore: root.networkConnectionStore
|
networkConnectionStore: root.networkConnectionStore
|
||||||
|
@ -231,6 +236,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: AppearanceView {
|
sourceComponent: AppearanceView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
appearanceStore: root.store.appearanceStore
|
appearanceStore: root.store.appearanceStore
|
||||||
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.appearance)
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.appearance)
|
||||||
|
@ -245,6 +251,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: LanguageView {
|
sourceComponent: LanguageView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
languageStore: root.store.languageStore
|
languageStore: root.store.languageStore
|
||||||
currencyStore: root.currencyStore
|
currencyStore: root.currencyStore
|
||||||
|
@ -259,6 +266,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: NotificationsView {
|
sourceComponent: NotificationsView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
notificationsStore: root.store.notificationsStore
|
notificationsStore: root.store.notificationsStore
|
||||||
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.notifications)
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.notifications)
|
||||||
|
@ -272,6 +280,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: SyncingView {
|
sourceComponent: SyncingView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
isProduction: production
|
isProduction: production
|
||||||
profileStore: root.store.profileStore
|
profileStore: root.store.profileStore
|
||||||
|
@ -289,6 +298,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: BrowserView {
|
sourceComponent: BrowserView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
store: root.store
|
store: root.store
|
||||||
accountSettings: localAccountSensitiveSettings
|
accountSettings: localAccountSensitiveSettings
|
||||||
|
@ -303,6 +313,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: AdvancedView {
|
sourceComponent: AdvancedView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
messagingStore: root.store.messagingStore
|
messagingStore: root.store.messagingStore
|
||||||
advancedStore: root.store.advancedStore
|
advancedStore: root.store.advancedStore
|
||||||
|
@ -320,6 +331,7 @@ StatusSectionLayout {
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.about)
|
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.about)
|
||||||
contentWidth: d.contentWidth
|
contentWidth: d.contentWidth
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
store: QtObject {
|
store: QtObject {
|
||||||
readonly property bool isProduction: production
|
readonly property bool isProduction: production
|
||||||
|
@ -358,6 +370,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: CommunitiesView {
|
sourceComponent: CommunitiesView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
profileSectionStore: root.store
|
profileSectionStore: root.store
|
||||||
rootStore: root.globalStore
|
rootStore: root.globalStore
|
||||||
|
@ -375,6 +388,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: KeycardView {
|
sourceComponent: KeycardView {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
|
|
||||||
profileSectionStore: root.store
|
profileSectionStore: root.store
|
||||||
keycardStore: root.store.keycardStore
|
keycardStore: root.store.keycardStore
|
||||||
|
@ -393,6 +407,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: SettingsContentBase {
|
sourceComponent: SettingsContentBase {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
sectionTitle: "Status Software Terms of Use"
|
sectionTitle: "Status Software Terms of Use"
|
||||||
contentWidth: d.contentWidth
|
contentWidth: d.contentWidth
|
||||||
|
|
||||||
|
@ -413,6 +428,7 @@ StatusSectionLayout {
|
||||||
sourceComponent: SettingsContentBase {
|
sourceComponent: SettingsContentBase {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
leftParentLayoutMargin: d.leftMargin
|
||||||
sectionTitle: "Status Software Privacy Statement"
|
sectionTitle: "Status Software Privacy Statement"
|
||||||
contentWidth: d.contentWidth
|
contentWidth: d.contentWidth
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,11 @@ FocusScope {
|
||||||
default property alias content: contentWrapper.children
|
default property alias content: contentWrapper.children
|
||||||
property alias titleLayout: titleLayout
|
property alias titleLayout: titleLayout
|
||||||
|
|
||||||
|
// This is the margin set up to the parent when using `SettingsContentBase` inside central
|
||||||
|
// panel property of `StatusSectionLayout` and needs to be taken into account to counteract it
|
||||||
|
// when trying to align horizontally the save toast component
|
||||||
|
required property int leftParentLayoutMargin
|
||||||
|
|
||||||
property bool dirty: false
|
property bool dirty: false
|
||||||
|
|
||||||
// Used to configure the dirty behaviour of the settings page as a must blocker notification when
|
// Used to configure the dirty behaviour of the settings page as a must blocker notification when
|
||||||
|
@ -152,7 +157,12 @@ FocusScope {
|
||||||
id: settingsDirtyToastMessage
|
id: settingsDirtyToastMessage
|
||||||
anchors.bottom: scrollView.bottom
|
anchors.bottom: scrollView.bottom
|
||||||
anchors.bottomMargin: d.bottomDirtyToastMargin
|
anchors.bottomMargin: d.bottomDirtyToastMargin
|
||||||
anchors.horizontalCenter: scrollView.horizontalCenter
|
|
||||||
|
// Left anchors and margin added bc of the implementation of the `SettingsContentBase` parent margin and to avoid
|
||||||
|
// this toast to be wrongly centered
|
||||||
|
anchors.left: root.left
|
||||||
|
anchors.leftMargin: -root.leftParentLayoutMargin / 2 + (root.width / 2 - width / 2)
|
||||||
|
|
||||||
active: root.dirty
|
active: root.dirty
|
||||||
flickable: root.autoscrollWhenDirty ? scrollView.flickable : null
|
flickable: root.autoscrollWhenDirty ? scrollView.flickable : null
|
||||||
saveChangesButtonEnabled: root.saveChangesButtonEnabled
|
saveChangesButtonEnabled: root.saveChangesButtonEnabled
|
||||||
|
|
Loading…
Reference in New Issue