This can be done in this way:
- Create an
FNotificationInfo, - Add the notification to the notification manager like this:
auto NotificationItem = SlateNotificationManager::Get().AddNotification( Info );, - Set its completion state:
NotificationItem->SetCompletionState(SNotificationItem::CS_Success); - Expire and fade out:
NotificationItem->ExpireAndFadeout();
Here is an example:
FNotificationInfo Info( LOCTEXT("HotReloadFinished", "Hot Reload Complete!") );
Info.Image = FEditorStyle::GetBrush(TEXT("LevelEditor.RecompileGameCode"));
Info.FadeInDuration = 0.1f;
Info.FadeOutDuration = 0.5f;
Info.ExpireDuration = 1.5f;
Info.bUseThrobber = false;
Info.bUseSuccessFailIcons = true;
Info.bUseLargeFont = true;
Info.bFireAndForget = false;
Info.bAllowThrottleWhenFrameRateIsLow = false;
auto NotificationItem = FSlateNotificationManager::Get().AddNotification( Info );
NotificationItem->SetCompletionState(SNotificationItem::CS_Success);
NotificationItem->ExpireAndFadeout();
GEditor->PlayEditorSound(CompileSuccessSound);