| Summary: | [Scrollable] Scrollable#getClientArea does not respect the size of visible scrollbars | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ivan Furnadjiev <ivan> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.5 | ||
| Target Milestone: | 2.0 M1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Fixed in master with commit 858996b31764a5ed2b3d6fce7f3a683dee0dff1a. |
The default implementation of Scrollable#getVScrollBarWidth() and Scrollable#getHScrollBarHeight() returns 0. These methods are package private and are overrided by controls like Table, Tree, List... In case of custom widget with scrollbars (like Nebula Grid), it's not possible to override these methods. The correct implementation of these methods is return the correct scrollbar width/height based on Scrollbar "visible" property. Test case: public void testGetClientArea_WithScrollbars() { Composite scrollable = new Composite( shell, SWT.V_SCROLL | SWT.H_SCROLL ); scrollable.getHorizontalBar().setVisible( true ); scrollable.getVerticalBar().setVisible( true ); scrollable.setSize( 100, 100 ); Rectangle expected = new Rectangle( 0, 0, 90, 90 ); assertEquals( expected, scrollable.getClientArea() ); }