How to change a custom toolbar button icon when clicked?

I added a custom button to the toolbar. And I was wondering whether it’d be possible to change the button’s icon when clicked. UE4’s buttons don’t do this and I found some hardcoded values set, e.g. from NiagaraEditorStyle.cpp

Style->Set("Niagara.CompileStatus.Warning", new IMAGE_BRUSH("Icons/CompileStatus_Warning", Icon40x40));
Style->Set("Niagara.CompileStatus.Warning.Small", new IMAGE_BRUSH("Icons/CompileStatus_Warning", Icon20x20));
Style->Set("Niagara.Asset.ReimportAsset.Needed", new IMAGE_BRUSH("Icons/icon_Reimport_Needed_40x", Icon40x40));
Style->Set("Niagara.Asset.ReimportAsset.Default", new IMAGE_BRUSH("Icons/icon_Reimport_40x", Icon40x40));

Note the Small, Default, Needed keywords. I wasn’t able to find where these are used or accessed. Maybe there is a .Hovered, .Clicked option? Where are these values being used?

1 Like