Listen to Changing IDE Theme

Answered

Hi Team,

I've come across the below listeners that can help capture the changing theme of the IDE. Which listener do you recommend?

  • LafManagerListener - LafManager provides methods to get the changing look and feel information. I cannot use such methods as they are either marked with “ApiStatus.Internal” or “Experimental”

     

  • EditorColorsListener - This provides theme information but via RGB. Based on the RGB values, I can determine the light/dark theme setting. 

     

  • UISettingsListener  - This listener helps me capture the theme changes and gets me the desired information directly with the help of UIManager.getLookAndFeel().getDefaults().get("ui.theme.is.dark").

    It's just the UISettingsListener.TOPIC that's marked with ApiStatus.Internal and it warns me.  

    The PluginVerifier reported about the usage of internal API but did not fail the build.                         I could see that tickets have been opened related to the usage of TOPIC. https://youtrack.jetbrains.com/issue/IJPL-163638/Clarify-ApiStatus.Internal-for-com.intellij.ide.ui.UISettingsListenerTOPIC                                                                                              Can we expect anything soon related to this or what's your suggestion in using this?

0
1 comment

Hi,

Use:

LafManagerListener

Experimental API can be used.

0

Please sign in to leave a comment.