Bug 178534 [Forms] Expandable Composite right margin computation bug
Build ID: I20070222-0951 Steps To Reproduce: 1.Make a form with a section 2.Add controls to the form More information: I noticed there was (marginWidth + thmargin) less to what should be the section's client width. I compared what i get to the screen shots in "UI Forms enhancements in release 3.3" (yes i did that! :)) and found that i add a two big margin on the right. I debugged the private layout of ExpandableComposite and i found that at line 332 (in release 3.3M5) int areaWidth = clientArea.width - marginWidth - marginWidth - thmargin - thmargin; int cx = marginWidth + thmargin; if ((expansionStyle & CLIENT_INDENT) != 0) { cx = x; areaWidth -= x; } But when that is called x equals to (marginWidth + thmargin) so after that areaWidth equals to clientArea.width - 3*marginWidth - 3*thmargin. Is that a bug or a feature ? If it is a bug then i propose the following: int areaWidth = clientArea.width - marginWidth - thmargin; int cx = marginWidth + thmargin; if ((expansionStyle & CLIENT_INDENT) != 0) { cx = x; } areaWidth -= cx;
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/forms/widgets/ExpandableComposite.java
int innertHint = innerwHint;
			Point tcsize = NULL_SIZE;
			if (textClient != null) {
				tcsize = textClientCache.computeSize(SWT.DEFAULT, SWT.DEFAULT);
			}
			Point size = NULL_SIZE;
			if (textLabel != null) {
				if (tcsize.x > 0 && FormUtil.isWrapControl(textClient)) {
					size = textLabelCache.computeSize(SWT.DEFAULT, SWT.DEFAULT);
					if (innertHint != SWT.DEFAULT && innertHint < size.x + IGAP + tcsize.x) {
						innertHint -= IGAP;
						if (textLabel instanceof Label) {
							GC gc = new GC(textLabel);
							size = FormUtil.computeWrapSize(gc, ((Label)textLabel).getText(), Math.round(innertHint*(size.x/(float)(size.x+tcsize.x))));
							gc.dispose();
						} else
							size = textLabelCache.computeSize(Math.round(innertHint*(size.x/(float)(size.x+tcsize.x))), SWT.DEFAULT);
						tcsize = textClientCache.computeSize(innertHint-size.x, SWT.DEFAULT);
					}
				} else {
					if (innertHint != SWT.DEFAULT && tcsize.x > 0)
						innertHint -= IGAP + tcsize.x;
					size = textLabelCache.computeSize(innertHint, SWT.DEFAULT);
				}
			}
			if (textLabel instanceof Label) {
				Point defSize = textLabelCache.computeSize(SWT.DEFAULT,
						SWT.DEFAULT);
				if (defSize.y == size.y) {