diff options
author | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2012-01-31 15:44:15 -0500 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2012-01-31 15:44:15 -0500 |
commit | 92000571a779c912f9d2bbe1c98caf331818d15b (patch) | |
tree | d76047fdf6f939af0b9f98ed9f12cdd0a4fb2c5d /bundles | |
parent | 2a6c4451d9a0891362f45912ce416ce64990a08b (diff) | |
download | eclipse.platform.swt-92000571a779c912f9d2bbe1c98caf331818d15b.tar.gz eclipse.platform.swt-92000571a779c912f9d2bbe1c98caf331818d15b.tar.xz eclipse.platform.swt-92000571a779c912f9d2bbe1c98caf331818d15b.zip |
368993 - Label with size hint {0, 0} layouted to {64, 64}
Diffstat (limited to 'bundles')
6 files changed, 9 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index 55e26ca171..5dc29c6d8c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -653,10 +653,6 @@ public Point computeSize (int wHint, int hHint, boolean changed) { } Point computeNativeSize (int /*long*/ h, int wHint, int hHint, boolean changed) { - return computeNativeSize (h, wHint, hHint, changed, DEFAULT_WIDTH, DEFAULT_HEIGHT); -} - -Point computeNativeSize (int /*long*/ h, int wHint, int hHint, boolean changed, int defaultWidth, int defaultHeight) { int width = wHint, height = hHint; if (wHint == SWT.DEFAULT && hHint == SWT.DEFAULT) { GtkRequisition requisition = new GtkRequisition (); @@ -673,8 +669,6 @@ Point computeNativeSize (int /*long*/ h, int wHint, int hHint, boolean changed, width = wHint == SWT.DEFAULT ? requisition.width : wHint; height = hHint == SWT.DEFAULT ? requisition.height : hHint; } - if (width == 0) width = defaultWidth; - if (height == 0) height = defaultHeight; return new Point (width, height); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java index 2de634602f..ef8661e2d1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java @@ -117,6 +117,8 @@ public Point computeSize (int wHint, int hHint, boolean changed) { if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); + if (size.x == 0 && wHint == SWT.DEFAULT) size.x = DEFAULT_WIDTH; + if (size.y == 0 && hHint == SWT.DEFAULT) size.y = DEFAULT_HEIGHT; int border = OS.gtk_container_get_border_width (handle); size.x += 2 * border; size.y += 2 * border; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index 5ea80a8294..a4bc31fb68 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -251,6 +251,8 @@ public Point computeSize (int wHint, int hHint, boolean changed) { if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); + if (size.x == 0 && wHint == SWT.DEFAULT) size.x = DEFAULT_WIDTH; + if (size.y == 0 && hHint == SWT.DEFAULT) size.y = DEFAULT_HEIGHT; Rectangle trim = computeTrim (0, 0, size.x, size.y); size.x = trim.width; size.y = trim.height; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index 222d6e603e..465fbec8f6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -482,6 +482,8 @@ public Point computeSize (int wHint, int hHint, boolean changed) { if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); + if (size.x == 0 && wHint == SWT.DEFAULT) size.x = DEFAULT_WIDTH; + if (size.y == 0 && hHint == SWT.DEFAULT) size.y = DEFAULT_HEIGHT; Rectangle trim = computeTrim (0, 0, size.x, size.y); size.x = trim.width; size.y = trim.height; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java index 4457c04c55..3d30124842 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java @@ -145,7 +145,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget (); if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; - return computeNativeSize (handle, wHint, hHint, changed, 0, 0); + return computeNativeSize (handle, wHint, hHint, changed); } Widget computeTabGroup () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index 67210ef839..6c9eefffe8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -537,6 +537,8 @@ public Point computeSize (int wHint, int hHint, boolean changed) { if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; Point size = computeNativeSize (handle, wHint, hHint, changed); + if (size.x == 0 && wHint == SWT.DEFAULT) size.x = DEFAULT_WIDTH; + if (size.y == 0 && hHint == SWT.DEFAULT) size.y = DEFAULT_HEIGHT; Rectangle trim = computeTrim (0, 0, size.x, size.y); size.x = trim.width; size.y = trim.height; |