RFR: 8300269: The selected item in an editable JComboBox with titled border is not visible in Aqua LAF [v2]

Damon Nguyen dnguyen at openjdk.org
Fri Jan 20 21:27:23 UTC 2023


On Fri, 20 Jan 2023 06:41:36 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add test
>
> src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java line 460:
> 
>> 458:         protected Rectangle rectangleForCurrentValue() {
>> 459:             int width = comboBox.getWidth();
>> 460:             int height = comboBox.getBorder() == null ? 22 : comboBox.getHeight();
> 
> Before JDK-8054572, comboBox.getHeight()+1 was used , shouldn't we use the same if we are going to fallback to previous way with border
> 
> `editorRect.height += 1;`
> 
> Also, it seems for TitledBorder the popupmenu is not aligned properly. It should have been at the base of the combobox, just as it is for without border...although I don think it's related to this fix but seems to be a bug nevertheless (in Date/Time macos settings, popupmenu for editable combobox is at the base)
> 
> ![image](https://user-images.githubusercontent.com/43534309/213630526-9cdc5401-d975-4bc3-9cd8-db3a01057d47.png)
> 
> =======
> Without border
> 
> ![image](https://user-images.githubusercontent.com/43534309/213632563-6df07625-22f6-4630-9d3b-511b5ff3cadd.png)

Adding 1 to the height would go back to the previous implementation, but it actually causes the comboBox to look more misaligned by 1 extra pixel. I can re-add the +1 to return to the original method if preferred.

<img width="63" alt="Screen Shot 2023-01-20 at 12 54 47 PM" src="https://user-images.githubusercontent.com/96267980/213807706-81de1e18-8922-43f4-8313-72d8332a20b1.png">

I see the popup issue on my end as well. But this seems to be unrelated to the fix as you mentioned. I can create a separate JBS issue for this if needed.

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

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



More information about the client-libs-dev mailing list