refactor(Notifications): turn reset button into link-like element

This is so that it looks and behaves as designed.
This commit is contained in:
Pascal Precht 2021-01-29 11:12:45 +01:00
parent ea2238f998
commit 1b009d634d
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 20 additions and 11 deletions

View File

@ -319,17 +319,26 @@ ScrollView {
anchors.right: parent.right
width: parent.width
StatusButton {
flat: true
horizontalPadding: 0
//% "Reset notification settings"
text: qsTrId("reset-notification-settings")
type: "warn"
onClicked: {
appSettings.notificationSetting = defaultAppSettings.notificationSetting
appSettings.notificationSoundsEnabled = defaultAppSettings.notificationSoundsEnabled
appSettings.notificationMessagePreviewSetting = defaultAppSettings.notificationMessagePreviewSetting
appSettings.allowNotificationsFromNonContacts = defaultAppSettings.allowNotificationsFromNonContacts
StyledText {
text: qsTr("Reset notification settings")
font.pixelSize: 15
color: Style.current.danger
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onEntered: {
parent.font.underline = true
}
onExited: {
parent.font.underline = false
}
onClicked: {
appSettings.notificationSetting = defaultAppSettings.notificationSetting
appSettings.notificationSoundsEnabled = defaultAppSettings.notificationSoundsEnabled
appSettings.notificationMessagePreviewSetting = defaultAppSettings.notificationMessagePreviewSetting
appSettings.allowNotificationsFromNonContacts = defaultAppSettings.allowNotificationsFromNonContacts
}
}
}