<Swing Dev> RFR: 8268084: [macos] Disabled JMenuItem arrow is not disabled

Sergey Bylokhov serb at openjdk.java.net
Thu Sep 2 04:49:32 UTC 2021


On Thu, 2 Sep 2021 04:18:47 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> src/java.desktop/macosx/classes/com/apple/laf/AquaMenuPainter.java line 301:
>> 
>>> 299:                 arrowIcon = new ImageIconUIResource(GrayFilter.
>>> 300:                         createDisabledImage(((ImageIcon)arrowIcon).getImage()));
>>> 301:             }
>> 
>> Maybe we do not need to duplicate LookAndFeel.getDisabledIcon() here and create a new disabled icon on each call for each menu item?
>> What about tweak the aqua arrow icon, so it will paint itself correctly for enabled/disabled states. Similar to how the MenuArrowIcon from the WindowsLookAndFeel and MetalLookAndFeel works.
>
> In MenuArrowIcon, the arrow icon is drawn there itself using drawPolygon but in Aqua, it is drawn via imageicon image so it will be a change in design and will make it more complex and it might introduce bug in hidpi/retina. I will like to keep it simple following the current design in aqua.

On windows it is painted via skin, I guess in GTK as well. But it really does not matter how it is drawn, the important part is that the icon itself knows how to draw proper appearance.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5310


More information about the swing-dev mailing list