Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 282133

Summary: [Menu] Layout is broken with big images
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.3   
Target Milestone: 1.3 M2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
screenshot none

Description Benjamin Muskalla CLA 2009-07-01 06:57:55 EDT
Setting a big image on a MenuItem leads to a broken layout of the menu item.
It seems that the determination of the x coordinates for the label does not check the image width.
Comment 1 Benjamin Muskalla CLA 2009-07-01 07:13:23 EDT
Snippet:


public class DemoWorkbench implements IEntryPoint {

  public int createUI() {
    Display display = new Display();
    Shell shell = new Shell( display );
    shell.setLayout( new FillLayout() );
    Composite c1 = new Composite( shell, SWT.BORDER );
    c1.setSize( 100, 100 );
    Menu menu = new Menu( shell, SWT.POP_UP );
    createItem( display, menu );
    createItem( display, menu );
    c1.setMenu( menu );
    shell.setSize( 300, 300 );
    shell.open();
    while( !shell.isDisposed() ) {
      if( !display.readAndDispatch() )
        display.sleep();
    }
    return 0;
  }

  private void createItem( Display display, Menu menu ) {
    MenuItem item = new MenuItem( menu, SWT.PUSH );
    item.setText( "Popup" );
    item.setImage( display.getSystemImage( SWT.ICON_ERROR ) );
  }
Comment 2 Benjamin Muskalla CLA 2009-07-01 07:17:05 EDT
Created attachment 140584 [details]
screenshot

.
Comment 3 RĂ¼diger Herrmann CLA 2009-08-25 09:01:31 EDT
Fixed by re-implementing the client-side menu (see bug 287097)