Open kalshen2018 opened 3 years ago
The main issue here is that you need to initialize all custom descriptors before you install L&F:
StyleManager.registerComponentDescriptor ( new MyImageDescriptor () );
WebLookAndFeel.install ();
This should fix the problem.
Unfortunately there is no good way to apply descriptor changes after L&F initialization yet, I might get around to find a solution for this later but for now it can only be done before L&F is installed.
I apologize for the very late response, notifications for a few last issues got somehow lost in the mail.
I might have actually been wrong since I didn't touch that part of WebLaF for a while. Your original order of operations was actually correct:
WebLookAndFeel.install ();
StyleManager.registerComponentDescriptor ( new MyImageDescriptor () );
But what exactly doesn't work in that case?
Your MyImagePainter
doesn't get called or?
I might have an idea what could be wrong, as I mentioned in #673:
I have a feeling that even with that order of operations - painters will not be overridden because they are loaded with skin and aren't updated after WebLookAndFeel.install ();
call is finished.
Would it help if you reapply skin after descriptors modification?
WebLookAndFeel.install ();
StyleManager.registerComponentDescriptor ( new MyImageDescriptor () );
StyleManager.setSkin ( new WebLightSkin () );
(or whichever skin you're using)
Thank you for your reply. I see the same issue in #673 , I will reapply skin after descriptors modification and reply to you in a few days .
I rewrite ImagePainter.java -> MyImagePainter.java and create new descriptor
and in my main function