Detect theme change and load dark/light css for my plugin window without the need to restart

Answered

 

Currently , i have written methods to load the light and dark theme but it happens only when i restart my plugin , i want to Detect theme change and load dark/light css for my plugin window  immediately without the need to restart. I have a class which implements ToolWindowFactory and its contents are shown are shown by overiding createToolWindowContent this method. I use JCEF browser to load the window content .

0
3 comments

i was thinking one solution can be if  i know what function is called when a theme change happens in intellij so that i can intercept that call and call my theme change method

0

I got a method in

LafManagerListener {

 @Override

 public void lookAndFeelChanged

//load the updated css

I used it and my theme is getting reloaded without restart but since 

I am using the JCEF browser to load the html content for the window so the contents of my tool window is getting lost.I dont want this  to happen. 

0

I don't think it's possible to easily replace CSS in existing web page.

0

Please sign in to leave a comment.