CTabFolder/CTabItem: Wrong font on CSS theme switch [message #1818367] |
Fri, 13 December 2019 06:25 |
Eclipse User |
|
|
|
Hello,
I try to switch (at runtime) between two css themes which I defined in extensions.
To do this, I use below code snippet:
final String themeId = ...;
final String currentThemeId = ThemeUtil.getCurrentThemeId();
if (!currentThemeId.equals(themeId)) {
final String[] availableThemeIds = ThemeUtil.getAvailableThemeIds();
final String newTheme = Arrays
.stream(availableThemeIds)
.filter(availableTheme -> availableTheme.equals(themeId))
.findAny()
.orElse("com.example.ui.mythemes.default");
ThemeUtil.setCurrentThemeId(RWT.getUISession(), newTheme);
}
But after reload, some ui components, like CTabFolder/CTabItem, ignores the new theme and continue to use the defaut font.
I found out that change from 'CTabItem.this.font' to 'getFont()' in CTabItem.java in getAdapter works for me but I'm not sure about that.
I know, use the ThemeUtil is not the best solution (because of internal and not api) but I don't know another way of solving the problem.
Is there neat solution? Or is not proposed that you can switch between css themes in RAP at runtime?
RAP 3.10
|
|
|
Powered by
FUDForum. Page generated in 0.02714 seconds