On Wed, 7 Dec 2022 10:25:31 GMT, Abhishek Kumar <[email protected]> wrote:
> In case of GTK LAF, the current selected element was not visible due to
> arrowbutton is rendered in entire display area of Combobox.
>
> The proposed fix is to set the `squareButton `property of combobox to `false
> `so that the arrowbutton didn't take entire combobox display area for
> rendering. The `getMinimumSize `method is overridden in `SynthComboBoxUI `to
> consider **arrowbutton insets** for combobox minimum size.
>
> The JCK tests mentioned in JBS seems fine with the fix.
> An automated test case is implemented to test in Nimbus and GTK LAF. The text
> color check is to ensure the current selected item is visible.
>
> When swing tests are run with LAF set to Nimbus and GTK LAF, few test
> failures observed.
>
> Although CI jobs looks ok with tests run in their default set LAFs.
>
> `open/test/jdk/javax/swing/JComboBox/TestComboBoxHeight.java` test passes if
> run in GTK LAF with current fix.
src/java.desktop/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java line
374:
> 372: size.height += insets.top + insets.bottom + arrowInsets.top
> 373: + arrowInsets.bottom;
> 374: size.width += insets.left + insets.right +arrowInsets.left
Suggestion:
size.width += insets.left + insets.right + arrowInsets.left
-------------
PR: https://git.openjdk.org/jdk/pull/11555