if (single) topRightRect.x += 4 + 3*BUTTON_SIZE/2;
boolean setButtonBounds() {	int oldX, oldY, oldWidth, oldHeight;	boolean changed = false;	Point size = getSize();		oldX = maxRect.x;	oldY = maxRect.y;	oldWidth = maxRect.width;	oldHeight = maxRect.height;	maxRect.x = maxRect.y = maxRect.width = maxRect.height = 0;	if (showMax) {		maxRect.x = size.x - borderRight - BUTTON_SIZE - 3;		if (borderRight > 0) maxRect.x += 1;		maxRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;		maxRect.width = BUTTON_SIZE;		maxRect.height = BUTTON_SIZE;	}	if (oldX != maxRect.x || oldWidth != maxRect.width ||	    oldY != maxRect.y || oldHeight != maxRect.height) changed = true;		oldX = minRect.x;	oldY = minRect.y;	oldWidth = minRect.width;	oldHeight = minRect.height;	minRect.x = minRect.y = minRect.width = minRect.height = 0;	if (showMin) {		minRect.x = size.x - borderRight - maxRect.width - BUTTON_SIZE - 3;		if (borderRight > 0) minRect.x += 1;		minRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - BUTTON_SIZE)/2: borderTop + (tabHeight - BUTTON_SIZE)/2;		minRect.width = BUTTON_SIZE;		minRect.height = BUTTON_SIZE;	}	if (oldX != minRect.x || oldWidth != minRect.width ||	    oldY != minRect.y || oldHeight != minRect.height) changed = true;		oldX = topRightRect.x;	oldY = topRightRect.y;	oldWidth = topRightRect.width;	oldHeight = topRightRect.height;	topRightRect.x = topRightRect.y = topRightRect.width = topRightRect.height = 0;	if (topRight != null) {		switch (topRightAlignment) {			case SWT.FILL:				int rightEdge = size.x - borderRight - minRect.width - maxRect.width - 1;				int lastIndex = getLastIndex();				if (lastIndex == -1) {					topRightRect.x = borderLeft + 3;					topRightRect.width = rightEdge - topRightRect.x;				} else {					CTabItem lastItem = items[lastIndex];					if (single) {						// fill size is 0 if item compressed						if (lastItem.x + lastItem.width >= rightEdge) {							break;						}					} else {						// fill size is 0 if chevron showing						if (firstIndex > 0 || lastIndex < items.length - 1) {							break;						}					}					topRightRect.x = lastItem.x + lastItem.width;					topRightRect.width = rightEdge - topRightRect.x;				}				break;			case SWT.RIGHT:				Point topRightSize = topRight.computeSize(SWT.DEFAULT, tabHeight);				if (single && selectedIndex > -1) {					CTabItem item = items[selectedIndex];					topRightRect.x = Math.min(item.x +item.width + BUTTON_SIZE, size.x - borderRight - minRect.width - maxRect.width - topRightSize.x - 3);				} else {					topRightRect.x = size.x - borderRight - minRect.width - maxRect.width - topRightSize.x - 3;				}				topRightRect.width = topRightSize.x;				break;			}			topRightRect.y = onBottom ? size.y - borderBottom - tabHeight: borderTop + 1;			topRightRect.height = tabHeight - 1;			topRight.setBounds(topRightRect);	}	if (oldX != topRightRect.x || oldWidth != topRightRect.width ||		oldY != topRightRect.y || oldHeight != topRightRect.height) {			changed = true;	}			oldX = chevronRect.x;	oldY = chevronRect.y;	oldWidth = chevronRect.width;	oldHeight = chevronRect.height;	chevronRect.x = chevronRect.y = chevronRect.height = chevronRect.width = 0;	if (single) {		if (selectedIndex == -1 || items.length > 1){			chevronRect.width = 3*BUTTON_SIZE/2;			chevronRect.height = BUTTON_SIZE + 2;			chevronRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - chevronRect.height)/2 : borderTop + (tabHeight - chevronRect.height)/2;			if (selectedIndex > -1) {				CTabItem item = items[selectedIndex];								chevronRect.x = Math.min(item.x +item.width + 3, size.x - borderRight - minRect.width - maxRect.width - topRightRect.width - chevronRect.width);			} else {				chevronRect.x = size.x - borderRight - minRect.width - maxRect.width - topRightRect.width - chevronRect.width;			}			if (borderRight > 0) chevronRect.x += 1;		}	} else {		if (items.length > 1) {			int lastIndex = getLastIndex();			if (firstIndex > 0 || lastIndex < items.length - 1) {				chevronRect.width = 3*BUTTON_SIZE/2;				chevronRect.height = BUTTON_SIZE + 2;				lastIndex = getLastIndex(); // last index may change when chevron is present				CTabItem lastItem = items[lastIndex];				chevronRect.x = Math.min(lastItem.x +lastItem.width + 3, size.x - borderRight - minRect.width - maxRect.width - topRightRect.width - chevronRect.width);				chevronRect.y = onBottom ? size.y - borderBottom - tabHeight + (tabHeight - chevronRect.height)/2 : borderTop + (tabHeight - chevronRect.height)/2;			}		}	}	if (oldX != chevronRect.x || oldWidth != chevronRect.width ||	    oldY != chevronRect.y || oldHeight != chevronRect.height) changed = true;		return changed;}