Tag Browse Tree : Colors and Transparency

Hello,

I would like to change the transparency of a Tag Browse Tree component. I looked around the DefaultTreeCellRenderer. It kind of works but there is something I must not do correctly as the background become “crazy” as soon as i use the Tag Browse Tree (in preview mode).

Here is the code I use :

from java.awt import Color
from javax.swing.tree import DefaultTreeCellRenderer

cellRenderer = DefaultTreeCellRenderer()

btr = event.source.parent.getComponent('Tag Browse Tree')

transparent = Color(0,0,0,0)
cellRenderer.setBackground(transparent)
cellRenderer.setBackgroundNonSelectionColor(transparent)
cellRenderer.setBackgroundSelectionColor(transparent)

btr.viewport.view.background = transparent
btr.viewport.view.setCellRenderer(cellRenderer)
btr.setBackground(transparent)

Window Initialisation:

After launching the script:

After Using the scrollbars:

After unselecting element or after window focus loss (desired appearance):

Is it possible to define the background color without having the color glitches shown in the screenshots ?

Note: Using scrollbars will bring back the weird background on the component, even if it has préviously shown the correct (and desired) background before.

Note: I’ve seen those stange color behaviors when trying to change the Alarme Status component colors as well.

I can provide logs, exports, code, if needed.

Regards.

It appears that the images of my previous post have not been saved.

They are now uploaded as attached files.







I was able to replicate this in the latest version of Ignition. I’ve filed a bug ticket.

Unfortunately, Java’s handling of transparancy is a bit non-intuitive, and we weren’t doing it right on components. We cleaned up a lot of them in various versions of 7.7, but it looks like we missed this one. :blush:

Thank you for the reply.

I guess it's still there in the Ignition 8.1.19 version. I'm also getting a similar kinds of it.