SWT: Detect OS theme change
In SWT, I have customized the look of my CTabFolder to match the system colors, in this case using SWT.COLOR_TITLE_BACKGROUND and SWT.COLOR_TITLE_FOREGROUND. The problem is that when the user changes the OS colors (for example by switching from the Windows Classic theme to some other theme), the CTabFolder retains the old colors.
So my question is: Does anybody know how to rece开发者_运维问答ive notification when the system colors and/or the OS theme changes? (Regularly polling the system colors is something I'd like to avoid.)
You can add a listener to the Display for SWT.Settings:
display.addListener(SWT.Settings, yourListener);
精彩评论