<Swing Dev> RFR: 8268084: [macos] Disabled JMenuItem arrow is not disabled
Prasanta Sadhukhan
psadhukhan at openjdk.java.net
Thu Sep 2 11:16:29 UTC 2021
On Thu, 2 Sep 2021 10:48:40 GMT, Sergey Bylokhov <serb 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.
>> 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.
>
>> 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.
>
>
> That is for MenuArrowIcon which is also there for Metal and Windows L&F in addition with MenuItemArrowIcon(). Aqua
> And depending on the state that icon can draws default arrow, or creates/caches the disabled icon.
I guess that is what it is being done, no? Instead of inside paintArrow() method, I am creating the disabled icon outside.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5310
More information about the swing-dev
mailing list