feat(ProfileShowcase): Save changes tooltip when disabled

- Replaced current `StatusButton` type to `DisabledTootipButton` to allow tooltip displayed when disabled in dirty toast message.
- Added needed conditions in `MyProfileView` where the tooltip when the save changes is disabled.

Closes #13334
This commit is contained in:
Noelia 2024-02-12 17:39:06 +01:00 committed by Noelia
parent a1c2d9a4b2
commit edf7e82932
2 changed files with 11 additions and 2 deletions

View File

@ -57,6 +57,9 @@ SettingsContentBase {
priv.hasAnyProfileShowcaseChanges
saveChangesButtonEnabled: !!descriptionPanel.displayName.text && descriptionPanel.displayName.valid
toast.saveChangesTooltipVisible: root.dirty
toast.saveChangesTooltipText: qsTr("Invalid changes made to Identity")
onResetChangesClicked: priv.reset()
onSaveChangesClicked: priv.save()

View File

@ -4,6 +4,8 @@ import QtGraphicalEffects 1.15
import utils 1.0
import shared.controls 1.0
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
@ -16,6 +18,8 @@ Rectangle {
property bool saveChangesButtonEnabled: false
property bool saveForLaterButtonVisible
property alias saveChangesText: saveChangesButton.text
property alias saveChangesTooltipText: saveChangesButton.tooltipText
property alias saveChangesTooltipVisible: saveChangesButton.enabled
property alias saveForLaterText: saveForLaterButton.text
property alias cancelChangesText: cancelChangesButton.text
property alias changesDetectedText: changesDetectedTextItem.text
@ -139,11 +143,13 @@ Rectangle {
onClicked: root.saveForLaterClicked()
}
StatusButton {
DisabledTooltipButton {
id: saveChangesButton
objectName: "settingsDirtyToastMessageSaveButton"
enabled: root.active && root.saveChangesButtonEnabled
buttonType: DisabledTooltipButton.Normal
text: qsTr("Save changes")
enabled: false
interactive: root.active && root.saveChangesButtonEnabled
onClicked: root.saveChangesClicked()
}
}