Windows7(ClearType enable)
Version: Oxygen.3 Release (4.7.3)
Build id: 20180308-1800
Hello,
The title text of SWT tab may not be ClearType.
In a simple application that only displays tabs, it becomes ClearType.
However, in my application it is not ClearType.
simple application
my application
There seems to be a cause in my application.
I still don't know what it is.
However, I know that if I change the draw method of the CTabRendering class of swt-tab-renderer specified in the CSS file as follows, it will become ClearType in my application.
Please let me know if you have any clues.
I hope I'm in the right place for my question.
Thanks for your help.
CSS file
.MPartStack {
/* swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering'); */
swt-tab-renderer: url('bundleclass://com.my.rcpapp/com.my.rcpapp.parts.CTabRendering2');
...
}
CTabRendering2 draw method
@Override
protected void draw(int part, int state, Rectangle bounds, GC gc) {
switch (part) {
...
default :;
if (0 <= part && part < parent.getItemCount()) {
gc.setAdvanced(true);
if (bounds.width == 0 || bounds.height == 0)
return;
if ((state & SWT.SELECTED) != 0) {
drawSelectedTab(part, gc, bounds);
state &= ~SWT.BACKGROUND;
Add -> gc.setAdvanced(false); // for ClearType
super.draw(part, state, bounds, gc);
Add -> gc.setAdvanced(true); // for ClearType
} else {
...
}
return;
}
}
super.draw(part, state, bounds, gc);
}