diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java index b28263b70f9..bad23442f90 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java @@ -1020,6 +1020,7 @@ public class OS extends C { public static final int OBJ_PEN = 0x1; public static final int OBM_CHECKBOXES = 0x7ff7; public static final int ODS_SELECTED = 0x1; + public static final int ODS_NOACCEL = 0x0100; public static final int ODS_INACTIVE = 0x80; public static final int ODT_MENU = 0x1; public static final int OIC_BANG = 0x7F03; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java index 3a9e27ca96b..190a2ab32d8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MenuItem.java @@ -1140,13 +1140,17 @@ LRESULT wmDrawChild(long wParam, long lParam) { int flags = SWT.DRAW_MNEMONIC | SWT.DRAW_DELIMITER; boolean isInactive = ((struct.itemState & OS.ODS_INACTIVE) != 0); boolean isSelected = ((struct.itemState & OS.ODS_SELECTED) != 0); + boolean isNoAccel = ((struct.itemState & OS.ODS_NOACCEL) != 0); Rectangle bounds = this.getBounds(); gc.setForeground(isInactive ? display.getSystemColor(SWT.COLOR_GRAY) : display.getSystemColor(SWT.COLOR_WHITE)); gc.setBackground(isSelected ? display.getSystemColor(SWT.COLOR_DARK_GRAY) : parent.getBackground()); int xMargin = DPIUtil.scaleDown(x + LEFT_TEXT_MARGIN, zoom) + (this.image != null ? this.image.getBounds().width : 0); int yMargin = DPIUtil.scaleDown(struct.top + MARGIN_HEIGHT, zoom); + + if(isNoAccel) { + gc.fillRectangle(DPIUtil.scaleDown(x, zoom), DPIUtil.scaleDown(struct.top + MARGIN_HEIGHT, zoom), DPIUtil.scaleDown(bounds.width + (image != null ? image.getBounds().width : 0), zoom), DPIUtil.scaleDown(bounds.height, zoom)); + } - gc.fillRectangle(DPIUtil.scaleDown(x, zoom), DPIUtil.scaleDown(struct.top + MARGIN_HEIGHT, zoom), DPIUtil.scaleDown(bounds.width + (image != null ? image.getBounds().width : 0), zoom), DPIUtil.scaleDown(bounds.height, zoom)); gc.drawText(this.text, xMargin, yMargin, flags); } if (image != null) {