feat(ProfileShowcase): Some properties prepared for task #13997 development

Part of #13997
This commit is contained in:
Noelia 2024-03-15 17:10:42 +01:00 committed by Noelia
parent c93a8d2c6f
commit 1d9c136bf8
2 changed files with 10 additions and 1 deletions

View File

@ -78,6 +78,10 @@ StatusSectionLayout {
readonly property bool isProfilePanelActive: profileContainer.currentIndex === Constants.settingsSubsection.profile
readonly property bool sideBySidePreviewAvailable: root.Window.width >= 1840 // design
// Used to alternatively add an error message to the dirty bubble if ephemeral notification
// can clash at smaller viewports
readonly property bool toastClashesWithDirtyBubble: root.Window.width <= 1650 // design
}
headerBackground: AccountHeaderGradient {
@ -142,6 +146,7 @@ StatusSectionLayout {
sectionTitle: root.store.getNameForSubsection(Constants.settingsSubsection.profile)
contentWidth: d.contentWidth
sideBySidePreview: d.sideBySidePreviewAvailable
toastClashesWithDirtyBubble: d.toastClashesWithDirtyBubble
}
}

View File

@ -39,6 +39,7 @@ SettingsContentBase {
property var communitiesModel
property bool sideBySidePreview
property bool toastClashesWithDirtyBubble
property QtObject dirtyValues: QtObject {
property string displayName: descriptionPanel.displayName.text
@ -72,7 +73,10 @@ SettingsContentBase {
toast.saveChangesTooltipText: saveChangesButtonEnabled ? "" : qsTr("Invalid changes made to Identity")
autoscrollWhenDirty: profileTabBar.currentIndex === MyProfileView.Identity
toast.loading: priv.expectedBackendResponses > 0
toast.additionalComponent.visible: false // TODO:Issue #13997 // !toast.loading && root.toastClashesWithDirtyBubble && priv.saveRequestFailed
toast.additionalComponent.text: qsTr("Changes could not be saved. Try again")
toast.additionalComponent.color: Theme.palette.dangerColor1
onResetChangesClicked: priv.reset()
onSaveChangesClicked: priv.save()