Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 178534 - [Forms] Expandable Composite right margin computation bug
Summary: [Forms] Expandable Composite right margin computation bug
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-21 09:18 EDT by Didier Villevalois CLA
Modified: 2011-04-29 14:25 EDT (History)
1 user (show)

See Also:


Attachments
Fix for the right margin computation (968 bytes, patch)
2007-03-21 09:19 EDT, Didier Villevalois CLA
cgold: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Villevalois CLA 2007-03-21 09:18:45 EDT
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;
Comment 1 Didier Villevalois CLA 2007-03-21 09:19:48 EDT
Created attachment 61535 [details]
Fix for the right margin computation
Comment 2 Chris Goldthorpe CLA 2011-04-18 20:19:40 EDT
Comment on attachment 61535 [details]
Fix for the right margin computation

I agree with your assessment. I modified the forms examples to use various values for the margins with and without the CLIENT_INDENT flag to test.
Comment 3 Chris Goldthorpe CLA 2011-04-18 20:22:16 EDT
Patch committed to HEAD, Fixed