Uncontrolled tool window Icon behavior

Hey!

I have a question about the Tool Window’s icon behavior, but I think it should work more commonly.

Icon of a window on the editor’ sides works like this:

Inactive state

image

Icons just present, no more

Inactive + Hovered state

Actually, there are no Active + hovered state

Active state

Plus hovered, but there are no changes

Inactive, focus changed from the window

I just opened another window (structure view)

Database still open, but inactive. Same as hovered effect


Build-in windows looks great in all states, but custom windows….

Hovered

Active

Inactive

Dark active

Dark inactive

image


I have the pot icon for dark and light themes, they’re named as pot.svg and pot_dark.svg

I set the icons in the plugin.xml file:

<extensions defaultExtensionNs="com.intellij">
    <toolWindow
            factoryClass="com.github.xepozz.php_dump.CompositeWindowFactory"
            id="PHP Dump" anchor="right" secondary="false" icon="/icons/pot.svg"/>
</extensions>

I looked through the plugin development documentation, SDK and sources.

I cannot find the way to change the icon in the active state.

Has somebody faced the same issue? Any ways to solve it?

Could you compare your icons to the standard ones in SVG? We usually do 4 icons for tool windows: 2 of 16x16 size and 2 of 20x20 size with some predefined colors. You can find source SVGs on the intellij-community repository

P.S. please avoid filled areas in tool window icons, they look out of place

In this example, you can see how it is done.

toolwindow

In light theme:

Read about colors here

object ComposeIcons {
    @JvmField
    val ComposeToolWindow =
        IconManager.getInstance().getIcon("/icons/composeToolWindow.svg", javaClass.getClassLoader())
}

And in plugin.xml:

        <toolWindow factoryClass="org.jetbrains.plugins.template.toolWindow.ComposeSamplesToolWindowFactory"
                    icon="org.jetbrains.plugins.template.ComposeIcons.ComposeToolWindow"
                    id="ComposeSamples"/>

One can also find a suitable tool window icon in our gallery

@yuriy.artamonov thanks for such quick reply. It really works great!

I’ve just moved fill=”…” attribute from the main <svg> tag into a child and the problem is solved.

Would be great to highlight that point in the icons documentation.