简体   繁体   中英

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 receive notification when the system colors and/or the OS theme changes? (Regularly polling the system colors is something I'd like to avoid.)

您可以向Display for SWT.Settings添加一个监听器:

display.addListener(SWT.Settings, yourListener);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM