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

Harshitha Onkar honkar at openjdk.org
Tue Feb 14 22:11:42 UTC 2023


On Tue, 14 Feb 2023 21:11:12 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> @DamonGuy  Additionally, you might need to make sure the conditional and the fix works under different combinations especially when you have an html with `<img>` tag + icon, both added to the button.
>
> Yes, I tested with these combinations:
> Icon with HTML image
> <img width="274" alt="Screen Shot 2023-02-14 at 12 30 23 PM" src="https://user-images.githubusercontent.com/96267980/218855067-68186106-77df-4c2b-81d7-2cd24e28f4bb.png">
> 
> Icon with HTML text
> <img width="270" alt="Screen Shot 2023-02-14 at 1 10 28 PM" src="https://user-images.githubusercontent.com/96267980/218863780-de2293ea-9da6-4db9-9201-4788b7567478.png">
> 
> And the `HtmlButtonImageTest` still passes as expected

Looks good.

I might have missed it earlier, adding an instanceof check makes it safer before calling getIcon(). What do you think?
`if (v != null && c instanceof AbstractButton && ((AbstractButton) c).getIcon() == null)){`

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

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



More information about the client-libs-dev mailing list