<Swing Dev> RFR: 8268084: [macos] Disabled JMenuItem arrow is not disabled
Sergey Bylokhov
serb at openjdk.java.net
Thu Sep 2 10:52:29 UTC 2021
On Thu, 2 Sep 2021 09:53:34 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> That is for MenuArrowIcon which is also there for Metal and Windows L&F in addition with MenuItemArrowIcon(). Aqua does not have it for MenuItem.
But this icon is used for the menuitem as well, isn't it? You can add this line to the test and check:
UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel");
+ UIManager.getDefaults().put("Menu.arrowIcon", "");
> The control for aqua menuitem goes via ImageIcon#paintIcon for menuitem arrow which does not have enabled/disabled parameter so it was done the way it is now.
I guess it is go via Icon.paintIcon() at AquaMenuPainter:408 , this is similar to metal and windows L&Fs. The first parameter of paintIcon is a component, so all information can be read there. And depending on the state that icon can draws default arrow, or creates/caches the disabled icon.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5310
More information about the swing-dev
mailing list