|
Lines 345-351
Link Here
|
| 345 |
} |
345 |
} |
| 346 |
perspectiveBar.update(true); |
346 |
perspectiveBar.update(true); |
| 347 |
setCoolItemSize(coolItem); |
347 |
setCoolItemSize(coolItem); |
| 348 |
|
|
|
| 349 |
} |
348 |
} |
| 350 |
} |
349 |
} |
| 351 |
}; |
350 |
}; |
|
Lines 422-433
Link Here
|
| 422 |
return; |
421 |
return; |
| 423 |
|
422 |
|
| 424 |
int rowHeight = toolbar.getItem(0).getBounds().height; |
423 |
int rowHeight = toolbar.getItem(0).getBounds().height; |
| 425 |
|
|
|
| 426 |
// This gets the height of the tallest item. |
| 427 |
for (int i = 1; i < perspectiveBar.getControl().getItemCount(); i++) { |
| 428 |
rowHeight = Math.max(rowHeight, perspectiveBar.getControl().getItem(i).getBounds().height); |
| 429 |
} |
| 430 |
|
| 431 |
Rectangle area = perspectiveCoolBar.getClientArea(); |
424 |
Rectangle area = perspectiveCoolBar.getClientArea(); |
| 432 |
int rows = rowHeight <= 0 ? 1 : (int)Math.max(1, Math.floor(area.height / rowHeight)); |
425 |
int rows = rowHeight <= 0 ? 1 : (int)Math.max(1, Math.floor(area.height / rowHeight)); |
| 433 |
if (rows == 1 || (toolbar.getStyle() & SWT.WRAP) == 0 || currentLocation == TOP_LEFT) { |
426 |
if (rows == 1 || (toolbar.getStyle() & SWT.WRAP) == 0 || currentLocation == TOP_LEFT) { |
|
Lines 674-679
Link Here
|
| 674 |
// make sure the selected item is visible |
667 |
// make sure the selected item is visible |
| 675 |
perspectiveBar.arrangeToolbar(); |
668 |
perspectiveBar.arrangeToolbar(); |
| 676 |
perspectiveBar.getControl().redraw(); |
669 |
perspectiveBar.getControl().redraw(); |
|
|
670 |
} |
| 671 |
|
| 672 |
/** |
| 673 |
* Updates the height of the CBanner |
| 674 |
*/ |
| 675 |
public void updateCBannerHeight() { |
| 676 |
if (topBar == null || perspectiveBar == null || perspectiveBar.getControl() == null) |
| 677 |
return; |
| 678 |
// This gets the height of the tallest tool item. |
| 679 |
int maxRowHeight = 0; |
| 680 |
ToolItem[] toolItems = perspectiveBar.getControl().getItems(); |
| 681 |
for (int i = 0; i < toolItems.length; i++) { |
| 682 |
maxRowHeight = Math.max(maxRowHeight, toolItems[i].getBounds().height); |
| 683 |
} |
| 684 |
// This sets the CBanner's minimum height to support large fonts |
| 685 |
topBar.setMinRightHeight(maxRowHeight); |
| 677 |
} |
686 |
} |
| 678 |
|
687 |
|
| 679 |
} |
688 |
} |