Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barnes2008-06-13 16:23:24 +0000
committerKevin Barnes2008-06-13 16:23:24 +0000
commitb61c3f172fe6902c0e52b83cd37cdefc535919b2 (patch)
treef25be785f40344769a368290c7205ad21ed179c2
parent21292329ff26bf3c445acc43d2250498baa74616 (diff)
downloadeclipse.platform.swt-b61c3f172fe6902c0e52b83cd37cdefc535919b2.tar.gz
eclipse.platform.swt-b61c3f172fe6902c0e52b83cd37cdefc535919b2.tar.xz
eclipse.platform.swt-b61c3f172fe6902c0e52b83cd37cdefc535919b2.zip
223391 - unable to change button sizes
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index db314d4450..e68662ce0a 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -564,18 +564,22 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
checkWidget();
int width = DEFAULT_WIDTH;
int height = DEFAULT_HEIGHT;
-// if (wHint != SWT.DEFAULT) width = wHint;
-// if (hHint != SWT.DEFAULT) height = hHint;
-// int border = getBorderWidth ();
-// width += border * 2;
-// height += border * 2;
-// return new Point (width, height);
if (topView() instanceof NSControl) {
NSRect oldRect = topView().frame();
((NSControl)topView()).sizeToFit();
NSRect newRect = topView().frame();
topView().setFrame (oldRect);
- return new Point ((int)newRect.width, (int)newRect.height);
+ width = (int) newRect.width;
+ height = (int)newRect.height;
+ }
+ int border = getBorderWidth ();
+ if (wHint != SWT.DEFAULT) {
+ width = wHint;
+ width += border * 2;
+ }
+ if (hHint != SWT.DEFAULT) {
+ height = hHint;
+ height += border * 2;
}
return new Point (width, height);
}

Back to the top