Skip to content

Commit 90e9056

Browse files
committed
feat: update Notify method to dynamically convert plugin icon
1 parent 9282e95 commit 90e9056

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

wox.core/plugin/api.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,16 @@ func (a *APIImpl) ShowApp(ctx context.Context) {
195195
}
196196

197197
func (a *APIImpl) Notify(ctx context.Context, message string) {
198+
icon := a.pluginInstance.Metadata.Icon
199+
if parsedIcon, err := common.ParseWoxImage(icon); err == nil {
200+
convertedIcon := common.ConvertIcon(ctx, parsedIcon, a.pluginInstance.PluginDirectory)
201+
icon = convertedIcon.String()
202+
}
203+
198204
GetPluginManager().GetUI().Notify(ctx, common.NotifyMsg{
199205
PluginId: a.pluginInstance.Metadata.Id,
200206
Text: a.GetTranslation(ctx, message),
201-
Icon: a.pluginInstance.Metadata.Icon,
207+
Icon: icon,
202208
DisplaySeconds: 5,
203209
})
204210
}

0 commit comments

Comments
 (0)