Custom icon doesn't show up for action group but action
已回答

plugin.xml
<actions>
<group id="CodegptGroup" text="Onegai Copilot" popup="true"
icon="com.snacks.onegai.codegpt.plugin.ui.Icons.logo">
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
<action id="com.snacks.onegai.codegpt.plugin.action.CodeRefactorAction"
class="com.snacks.onegai.codegpt.plugin.action.CodeRefactorAction"
icon="com.snacks.onegai.codegpt.plugin.ui.Icons.logo"
text="Code refactor">
</action>
</group>
</actions>
logo code:
object Icons {
private fun loadIcon(path: String): Icon {
return IconLoader.getIcon(path, Icons::class.java)
}
@JvmField
val logo = loadIcon("/icons/logo.svg")
}
请先登录再写评论。
as you see - Code refactor with an Icon
but Onegai Copilot didn't show up
Hi, I suggest not adding group icons as it will be inconsistent with the general IDE UI. See: https://plugins.jetbrains.com/docs/intellij/plugin-user-experience.html#consistent-and-good-looking-ui
If you still want to do it, take a look at https://intellij-support.jetbrains.com/hc/en-us/community/posts/206769015-Icon-for-groups-in-plugin-xml
class CopilotActionGroup : DefaultActionGroup("Onegai Copilot", true) {init {
templatePresentation.icon = CopilotIcons.logo
}
}
I had also tried that seems not to work but works when you runIde mode

IntelliJ IDEA 2023.1 (Ultimate Edition) - Build #IU-231.8109.175, built on March 28, 2023
runIde mode work
install the plugin after its build not working - icon was empty

Karol Lewandowski
The issue was confirmed only happened when using Ultimate Edition, but works for Community Edition
Has this problem been solved? I have the same confusion.
runIde mode has icon, but after build has't icon.
not yet. you can try Community Edition it's works
I find some clues, The ‘action group icon’ not show up in IDE NewUI mode.
because I runIde on oldUI, after build on newUI.
Any workaround for this problem so far?
I'm facing the same issue on both Community and Ultimate Edition. I'm using Intellij 2024.2.4 version
Hi,
If the solution with a custom action group class doesn't work, then I suggest creating an issue at https://youtrack.jetbrains.com/issues/IJPL.