GUI Elements enable / disable
Answered
Hi, I tested my plugin with the newest Pycharm 2023.3.1 and all the disabled buttons in the plugin lost the grayed-out effect, and look like they are enabled:

But they are in fact disabled - not clickable. In 2023.2.5 it was all OK:

I'm using the standard setEnabled() method for enabling/disabling the buttons. Do I need to do something additional to get the buttons look disabled and grayed-out?
Thanks,
Milo
Please sign in to leave a comment.
What API are you using here? Could you please share a code snippet?
Hi Yann,
It's classic JButton:
Why don't you use this API https://plugins.jetbrains.com/docs/intellij/basic-action-system.html#building-ui-from-actions?
Well, I could, but at this stage I want to avoid big changes in the code, the project is in the maintain phase. There must be a reason why this stopped working in 2023.3. Maybe the New UI? What could I do to get this working with the JButton?
Milo
What happens if you disable New UI in 2023.3? Could you please share your sources or the plugin for reproducing?
Hi Yann,
with disabled New UI the behavior is the same. I did couple of tests, and found out, that the JButton's text is correctly disabled. Only the icon always has the ‘enabled' appearance.
You can install the plugin from here: https://plugins.jetbrains.com/plugin/19828-rohde--schwarz-instrument-connectivity
However, you'd need a measurement instrument that supports VISA interface to test this. Therefore, to reproduce it, I created a simple plugin with one ToolWindow, JPanel as content with one disabled JButton - text and icon. You can see from the picture, that the text is disabled, but the icon looks enabled:
Here's the code for InstrumentsListToolWindowFactory.java :
The plugin.xml file:
The build.gradle:
Hope you can help to resolve this
Milo
Sorry for delay, investigating.
Thanks for your report, please track https://youtrack.jetbrains.com/issue/IDEA-344212/Disabled-JButton-icons-not-greyed for progress.