Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327252 - [ScrolledComposite] Scrollbars are displayed unnecessarily
Summary: [ScrolledComposite] Scrollbars are displayed unnecessarily
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-07 11:31 EDT by Benjamin Wolff CLA
Modified: 2010-10-07 16:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Wolff CLA 2010-10-07 11:31:29 EDT
With the current RAP CVS version the scrollbars of a ScrolledComposite are displayed unnecessarily. It can be reproduced with the following snippet:


public class View extends ViewPart {

	public static final String ID = "scrolled_comp_bug.view";

	@Override
	public void createPartControl(Composite parent) {
		ScrolledComposite scrolledComp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
		scrolledComp.setExpandHorizontal(true);
		scrolledComp.setExpandVertical(true);

		Composite comp = new Composite(scrolledComp, SWT.NONE);
		GridLayoutFactory.swtDefaults().applyTo(comp);
		scrolledComp.setContent(comp);
		scrolledComp.setMinSize(comp.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	}

	@Override
	public void setFocus() {}

}


This should be the default idiom for using a ScrolledComposite to show the scrollbars if the content of the composite does not fit in the receivers window.
However, in this case the scrollbars are display allthough the content fits into the window. Using the same snippet in RCP does not show the scrollbars.

The problem can be reproduced with FF 3.6, Chrome & IE8.

This issue exists since the fix of this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327150
Comment 1 Benjamin Wolff CLA 2010-10-07 11:33:52 EDT
Sorry, i was refering to this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326751
Comment 2 Tim Buschtoens CLA 2010-10-07 16:52:26 EDT
Fixed in CVS HEAD.
ScrolledCompositeLCA had assumed wrong default-values for scrollbar-visibility. 

@Benjamin: It should now work again as expected, otherwise reopen bug.