JosefNemec / Playnite

Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
https://playnite.link
MIT License
8.66k stars 482 forks source link

Option for plugins to set the parent icon for a nested `GameMenuItem` #3762

Open mtkennerly opened 2 weeks ago

mtkennerly commented 2 weeks ago

Feature description

In this screenshot, I'd like "restore save data..." to have an icon, but I can only seem to add it for the individual backups (the nested options on the right):

image

The individual backups are defined as:

new GameMenuItem
{
    Description = Etc.GetBackupDisplayLine(backup),
    MenuSection = string.Format("{0} | {1}", translator.Ludusavi(), translator.RestoreSelectedGames_Label()),
    Action = async args => { /* ... */ }
}

If I add an extra GameMenuItem for the parent with an icon, then I get one with the icon and one without:

image

new GameMenuItem
{
    Description = translator.RestoreSelectedGames_Label(),
    MenuSection = translator.Ludusavi(),
    Icon = interactor.GetIcon(Icon.UploadAlt)
}

Screenshots

No response