Skip to content

fix: use Minecraft theme icons in notification toasts - #1225

Open
RedSavant wants to merge 3 commits into
Polyfrost:v1from
RedSavant:fix/minecraft-toast-icons
Open

RedSavant wants to merge 3 commits into
Polyfrost:v1from
RedSavant:fix/minecraft-toast-icons

Conversation

@RedSavant

Copy link
Copy Markdown

Description

Notification toasts always used the default icons, even with the Minecraft theme. The notifications center in the main menu already showed the Minecraft icons, because it goes through the themed Icon component and MinecraftIconOverrides.

The toasts are drawn by the notifications module, which doesn't know about the UI themes. Instead, the theme is pushed to it by syncNotificationTheme, which already passed the colours, fonts and corner radii but not the icons. So SvgRasterizer always loaded /assets/oneconfig/ico/<name>.svg.

This PR:

  • adds an iconFolder property to NotificationTheme, set by syncNotificationTheme to "minecraft" when a Minecraft theme is active and to null otherwise
  • makes SvgRasterizer.get look in ico/<folder>/ first, falling back to the default icon when there's no override
  • passes the folder from ToastIcon

The Minecraft versions of all four type icons (info, check-circle, alert-circle, refresh) already exist, so no new assets are needed.

The setter is a separate useIconFolder function rather than a new parameter on set(...), so the existing set signature stays binary compatible. The API dump only has additions.

Tested on 26.3-fabric with /testmod notifyTest and /testmod notifyProgress, in Minecraft Dark and PolyGlass Dark.

Before After
image image

Related Issue(s)

Closes #1066

Checklist

  • I made a clear description of what was changed
  • I stated why these changes were necessary
  • I updated documentation or said what needs to be updated
  • I made sure these changes are backwards compatible
  • This pull request is for one feature/bug fix

@saadndm

saadndm commented Oct 20, 2026

Copy link
Copy Markdown
Member

Thanks, can you also fix the notification bell icon here:

val resolvedColor = if (color == Color.Unspecified) LocalTheme.current.textColor else color
Box {
val painter = rememberSvgResourcePainter("/assets/oneconfig/ico/$iconName.svg")
if (painter != null) Image(
painter = painter,
contentDescription = null,
modifier = modifier.size(18.dp),
colorFilter = ColorFilter.tint(resolvedColor)
)

It can just be:

     Box {
        Icon(iconName, color, modifier)

@RedSavant

Copy link
Copy Markdown
Author

With pleasure! Ill sort it out straight away

@RedSavant

Copy link
Copy Markdown
Author
Before After
image image

That's done ! Bell use theme icon

@RedSavant

Copy link
Copy Markdown
Author

Closes #1067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

notification in minecraft theme does not have the right info icon

2 participants