Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT tab title text may not be ClearType(SWT tab title text may not be ClearType)
SWT tab title text may not be ClearType [message #1815306] Mon, 30 September 2019 09:02
Ken Enjoji is currently offline Ken EnjojiFriend
Messages: 1
Registered: September 2019
Junior Member
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
index.php/fa/36430/0/

my application
index.php/fa/36431/0/

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);
}
Previous Topic:Breakpoint debug SelectionListener freeze eclipse and Win10 OS
Next Topic:Calender control under swt table {CellEditor}
Goto Forum:
  


Current Time: Sun Dec 01 20:46:41 GMT 2024

Powered by FUDForum. Page generated in 0.02610 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top