- 
                Notifications
    You must be signed in to change notification settings 
- Fork 185
Open
Labels
WindowsHappens on Windows OSHappens on Windows OSbugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
Windows 11
Eclipse 4.26
Run this Snippet on Windows 10 and Window 11 and compare the drop down menu after selecting it:
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
public class MenuImageTest {
    
	public static void main(String[] args) {
		final Display display = new Display();
		Shell shell = new Shell(display);
		shell.setText("Menu Image Test");
		
		Menu appMenuBar = display.getMenuBar();
		if(appMenuBar == null) {
			appMenuBar = new Menu(shell, SWT.BAR);
			shell.setMenuBar(appMenuBar);
		}
		
		MenuItem file = new MenuItem(appMenuBar, SWT.CASCADE);
		file.setText("File");
		
		Menu dropdown = new Menu(appMenuBar);
		file.setMenu(dropdown);
		
		MenuItem testMenu = new MenuItem(dropdown, SWT.CHECK);
		testMenu.setImage(new Image(display, MenuImageTest.class.getResourceAsStream("image.png")));
		testMenu.setText("Test Menu");
		
		shell.open();
		
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
}Use an image for image.png such as:
On Windows 10 selected state looks like this:
In Windows 11 selected state looks like this:
Metadata
Metadata
Assignees
Labels
WindowsHappens on Windows OSHappens on Windows OSbugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed


