summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2005-05-06 13:48:21 +0000
committerVeronika Irvine <veronika>2005-05-06 13:48:21 +0000
commit99a2381bbc6fc850bd79975547006e7b05a0d94b (patch)
treeb97b6b26f38125bf8cf6d74d5e03f3e3ab69577a
parent24569b598a729233dea8754d5321c284fe1174a6 (diff)
downloadeclipse.platform.swt-99a2381bbc6fc850bd79975547006e7b05a0d94b.tar.gz
eclipse.platform.swt-99a2381bbc6fc850bd79975547006e7b05a0d94b.tar.xz
eclipse.platform.swt-99a2381bbc6fc850bd79975547006e7b05a0d94b.zip
Bug79631 show min and max even if no tabs created
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
index b681f6fa5a..cafacdd9af 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java
@@ -574,13 +574,8 @@ void destroyItem (CTabItem item) {
if (control != null && !control.isDisposed()) {
control.setVisible(false);
}
- if (fixedTabHeight == SWT.DEFAULT) tabHeight = 0;
- if (onBottom) {
- yClient = borderTop + highlight_margin + marginHeight;
- } else {
- yClient = borderTop + tabHeight + highlight_header + marginHeight;
- }
hideToolTip();
+ setButtonBounds();
redraw();
return;
}
@@ -1097,11 +1092,9 @@ void drawTabArea(Event event) {
}
// Draw Buttons
- if (items.length > 0) {
- drawChevron(gc);
- drawMinimize(gc);
- drawMaximize(gc);
- }
+ drawChevron(gc);
+ drawMinimize(gc);
+ drawMaximize(gc);
// Draw border line
if (borderLeft > 0) {
@@ -3736,8 +3729,12 @@ boolean updateTabHeight(boolean force){
} else {
int tempHeight = 0;
GC gc = new GC(this);
- for (int i=0; i < items.length; i++) {
- tempHeight = Math.max(tempHeight, items[i].preferredHeight(gc));
+ if (items.length == 0) {
+ tempHeight = gc.textExtent("Default", CTabItem.FLAGS).y + CTabItem.TOP_MARGIN + CTabItem.BOTTOM_MARGIN; //$NON-NLS-1$
+ } else {
+ for (int i=0; i < items.length; i++) {
+ tempHeight = Math.max(tempHeight, items[i].preferredHeight(gc));
+ }
}
gc.dispose();
tabHeight = tempHeight;