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
/**
 * This composite is capable of expanding or collapsing a single client that is
 * its direct child. The composite renders an expansion toggle affordance
 * (according to the chosen style), and a title that also acts as a hyperlink
 * (can be selected and is traversable). The client is layed out below the title
 * when expanded, or hidden when collapsed.
 * <p>
 * The widget can be instantiated as-is, or subclassed to modify some aspects of
 * it. *
 * <p>
 * Since 3.1, left/right arrow keys can be used to control the expansion state.
 * If several expandable composites are created in the same parent, up/down
 * arrow keys can be used to traverse between them. Expandable text accepts
 * mnemonics and mnemonic activation will toggle the expansion state.
 * 
 * <p>
 * While expandable composite recognize that different styles can be used to
 * render the title bar, and even defines the constants for these styles (<code>TITLE_BAR</code>
 * and <code>SHORT_TITLE_BAR</code> the actual painting is done in the
 * subclasses.
 * 
 * @see Section
 * @since 3.0
 */
public class ExpandableComposite extends Canvas {
	/**
	 * If this style is used, a twistie will be used to render the expansion
	 * toggle.
	 */
	public static final int TWISTIE = 1 << 1;