summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand <aweinand>2002-11-01 16:45:18 +0000
committerAndre Weinand <aweinand>2002-11-01 16:45:18 +0000
commitfa0684f848e1d16bf9f5e376572341decc3cc7f4 (patch)
tree4115dd18686c2f190e45f2497404e976dd90a9e5
parent3b1662982081ff5c011263c21107a9ba88a49137 (diff)
downloadeclipse.platform.swt-fa0684f848e1d16bf9f5e376572341decc3cc7f4.tar.gz
eclipse.platform.swt-fa0684f848e1d16bf9f5e376572341decc3cc7f4.tar.xz
eclipse.platform.swt-fa0684f848e1d16bf9f5e376572341decc3cc7f4.zip
workaround for Tab control refresh problem on resize
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java27
1 files changed, 19 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java
index 7d1101d141..69243aa818 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/TabFolder.java
@@ -660,13 +660,13 @@ void internalGetControlBounds(int hndl, Rect bounds) {
* x and y are relative to window!
*/
void handleResize(int hndl, Rect bounds) {
-
- bounds.left+= MARGIN;
- bounds.right-= MARGIN;
- bounds.top+= TOP_MARGIN;
- bounds.bottom-= MARGIN;
- super.handleResize(hndl, bounds);
+ bounds.left += MARGIN;
+ bounds.top += TOP_MARGIN;
+ bounds.right -= MARGIN;
+ bounds.bottom -= MARGIN;
+ OS.SetControlBounds(handle, bounds);
+
if (handle != 0) {
int selectedIndex= OS.GetControl32BitValue(handle)-1;
if (selectedIndex != -1) {
@@ -675,8 +675,19 @@ void handleResize(int hndl, Rect bounds) {
control.setBounds(getClientArea());
}
}
- redraw();
+ // redraw(); // only required if the workaround from below is not in place
}
+
+ /*
+ * There seems to be a layout/clipping bug with Tab control in compositing
+ * mode (HIViews): on resize if the old size is more than a few pixel
+ * different from the new size, a rectangular area to the right or left of
+ * the tabs isn't repaired. The fix is to make the tab control temporarily
+ * one pixel larger.
+ */
+ bounds.right--;
+ OS.SetControlBounds(handle, bounds);
+ bounds.right++;
+ OS.SetControlBounds(handle, bounds);
}
-
}