Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336057 - CoolBar overlap its items
Summary: CoolBar overlap its items
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.4 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-02 07:05 EST by Yury CLA
Modified: 2011-02-02 09:28 EST (History)
1 user (show)

See Also:


Attachments
demo.png (19.91 KB, image/png)
2011-02-02 07:06 EST, Yury CLA
no flags Details
planning(good).png (21.22 KB, image/png)
2011-02-02 07:06 EST, Yury CLA
no flags Details
planning(bad).png (21.34 KB, image/png)
2011-02-02 07:07 EST, Yury CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yury CLA 2011-02-02 07:05:41 EST
Build Identifier: RAP 1.3

CoolItems are wrongly positioned on its CoolBar panel in case of small panel size.

Reproducible: Always

Steps to Reproduce:
1. Run DemoWorkbench application from org.eclipse.rap.demo.
2. Switch to Demo perspective.
3. Reduce window size like it is shown on (demo.png)
4. Switch perspective to Planning. You will see problem as on Planning(bad).png.

If you switch to Planning perspective before size reducing - everything is OK (see Planning(good).png).
Comment 1 Yury CLA 2011-02-02 07:06:18 EST
Created attachment 188126 [details]
demo.png
Comment 2 Yury CLA 2011-02-02 07:06:47 EST
Created attachment 188127 [details]
planning(good).png
Comment 3 Yury CLA 2011-02-02 07:07:13 EST
Created attachment 188128 [details]
planning(bad).png
Comment 4 Yury CLA 2011-02-02 07:08:15 EST
I've found that following fixes in CoolItem.js resolve the problem.

    // reparenting to enable coolitem dragging
    setControl : function( control ) {
      if( control != null ) {
        // TODO [tb] : Control positioning is already handled by server
        control.setTop( this.getTop() );
        control.setLeft( this.getLeft()
                         + org.eclipse.swt.widgets.CoolItem.CONTROL_OFFSET );
        control.setDisplay( true );
      }
      if( this._control != null ) {
        this._control.setDisplay( false );
      }
      this._control = control;
    },



Using

control.setTop( this.getTop() ); 


instead of

control.setTop( 0 );
Comment 5 Ivan Furnadjiev CLA 2011-02-02 08:21:00 EST
This is reproducible with CVS HEAD too.
Comment 6 Ivan Furnadjiev CLA 2011-02-02 09:28:59 EST
Fixed in CVS HEAD by removing the control.setTop at all. As control bounds are calculated by the server, setTop is not needed.