RFR: 8302173: Button border overlaps with button icon on macOS system LaF

Damon Nguyen dnguyen at openjdk.org
Tue Feb 14 19:57:41 UTC 2023


On Tue, 14 Feb 2023 19:31:34 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> src/java.desktop/macosx/classes/com/apple/laf/AquaButtonUI.java line 343:
>> 
>>> 341:         final String text;
>>> 342:         final View v = (View)c.getClientProperty(BasicHTML.propertyKey);
>>> 343:         if (v != null && ((AbstractButton) c).getText().contains("<img ")) {
>> 
>> You might want to test a combination of HTML image + icon added to JButton, to make sure the fix works correctly under different combinations.
>> 
>> Suggestion: Does having `((AbstractButton) c).getIcon() == null` make it more robust than checking for html tag patterns ?
>
> The icon isn't the HTML image like in the similar test `HtmlButtonImageTest`. This time the HTML is the text and the icon is simply a separate image. This is the cause of the issue. The importance will be if the HTML contents is actually an image or just HTML text.

Nevermind, I see your point now that I've reread this. Checking for an icon achieves the same effect without having to check for an img pattern as long as one is adjusted. So, I think the icon check is more robust and cleaner. Thanks!

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

PR: https://git.openjdk.org/jdk/pull/12520



More information about the client-libs-dev mailing list