Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ void init(int style) {
case SWT.Selection: onSelection(event); break;
case SWT.Activate: onActivate(event); break;
case SWT.Deactivate: onDeactivate(event); break;
case SWT.ZoomChanged: onZoomChange(event); break;
}
};

Expand All @@ -362,14 +363,20 @@ void init(int style) {
SWT.Resize,
SWT.Traverse,
SWT.Activate,
SWT.Deactivate
SWT.Deactivate,
SWT.ZoomChanged
};
for (int folderEvent : folderEvents) {
addListener(folderEvent, listener);
}

initAccessible();
}

private void onZoomChange(Event event) {
update();
}

void onDeactivate(Event event) {
if (!highlightEnabled) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public class CTabFolderRenderer {
static final int FLAGS = SWT.DRAW_TRANSPARENT | SWT.DRAW_MNEMONIC | SWT.DRAW_DELIMITER;
static final String ELLIPSIS = "..."; //$NON-NLS-1$
private static final String CHEVRON_ELLIPSIS = "99+"; //$NON-NLS-1$
private static final int CHEVRON_FONT_HEIGHT = 10;
private static final float CHEVRON_FONT_SIZE_FACTOR = 0.7f;
private static final int CHEVRON_BOTTOM_INDENT = 4;

//Part constants
/**
Expand Down Expand Up @@ -926,7 +927,7 @@ void drawChevron(GC gc, Rectangle chevronRect, int chevronImageState) {
Display display = parent.getDisplay();
Font font = getChevronFont(display);
int fontHeight = font.getFontData()[0].getHeight();
int indent = Math.max(2, (chevronRect.height - fontHeight - 4) /2);
int indent = Math.max(2, (chevronRect.height - fontHeight - CHEVRON_BOTTOM_INDENT) /2);
int x = chevronRect.x + 2;
int y = chevronRect.y + indent;
int count = parent.getChevronCount();
Expand Down Expand Up @@ -1696,9 +1697,8 @@ Color getFillColor() {

private Font getChevronFont(Display display) {
if (chevronFont == null) {
Point dpi = display.getDPI();
int fontHeight = 72 * CHEVRON_FONT_HEIGHT / dpi.y;
FontData fd = parent.getFont().getFontData()[0];
int fontHeight = (int) (fd.height * CHEVRON_FONT_SIZE_FACTOR);
fd.setHeight(fontHeight);
chevronFont = new Font(display, fd);
}
Expand Down
Loading