Skip to content

Conversation

@chriadam
Copy link
Contributor

Non-notification toasts which are of type Warning or Error cannot be silenced as they cannot cause an alarm, since only notification backed toasts can cause alarms.

This commit ensures that the "Silence" button will only be shown for notification-backed warning/error toasts, and that the normal "X" (dismiss/close) button is shown for non-notification-backed toasts.

Contributes to issue #2675

radius: isSilenceButton ? Theme.geometry_button_radius : Theme.geometry_button_border_width

onClicked: {
if (isSilenceButton) {
Copy link
Contributor

@ybott-qinetic ybott-qinetic Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this if statement condition redefined? The binding looks the same, but maybe I missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, will undo this

// unacknowledged notifications in the Notifications navbar icon bubble number.
ToastModel.removeAllInfoExcept(root.toastModelId)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this whitespace change intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, intentional, since we now have two separate if statements plus an unconditional

Non-notification toasts which are of type Warning or Error cannot
be silenced as they cannot cause an alarm, since only notification
backed toasts can cause alarms.

This commit ensures that the "Silence" button will only be shown
for notification-backed warning/error toasts, and that the normal
"X" (dismiss/close) button is shown for non-notification-backed
toasts.

Contributes to issue #2675
@chriadam chriadam force-pushed the chriadam/toast-warning-dismiss branch from c15cf9d to e40ecc8 Compare November 25, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants