[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Integrated: 7093691: Nimbus LAF: disabled JComboBox using renderer has bad font color
From:       Damon Nguyen <dnguyen () openjdk ! org>
Date:       2023-03-27 17:07:57
Message-ID: 5pUrKvW1SjpJQzldaRlqCJNek6nvU4N4LhJyXlhi6_M=.ea06e002-3d98-4998-b3f2-667a4f1230e5 () github ! com
[Download RAW message or body]

On Thu, 2 Feb 2023 16:33:06 GMT, Damon Nguyen <dnguyen@openjdk.org> wrote:

> Before the fix, a JComboBox in Nimbus L&F would have normal black text even when \
> the JComboBox was disabled if SynthComboBoxRenderer was replaced with a \
> DefaultListCellRenderer. This text should be greyed out like in other L&F's. When \
> looking into the defaults for Nimbus L&F files for attributes and states of a \
> JComboBox, it confirm that the intention for disabled JComboBoxes is \
> nimbusDisabledText (which is grey text). 
> SynthComboBoxes have an additional check in its default SynthComboBoxRenderer that \
> enables/disables the renderer itself. The SynthComboBoxRenderer inherits its \
> enabled state from the parent ComboBox. Since the renderer with \
> DefaultListCellRenderer is in a separate class without a reference to the comboBox, \
> a listener was added to SynthComboBoxUI. 
> An additional issue occurred in DefaultListCellRenderer because the renderer \
> overrode the listener's re-assigned enabled state. In testing, setting the enabled \
> state in DefaultListCellRenderer is redundant for all L&F's and is not needed here. \
> However, instead of removing it altogether, a conditional was added specifically to \
> allow ComboBoxes to skip setting enabled state here. 
> After the fix, the Nimbus JComboBox with DLCR set matches the appearance of a \
> normal Nimbus JComboBox. I can enable/disable the JComboBoxes in the test, and the \
> UI elements behave and appear as expected.

This pull request has now been integrated.

Changeset: 87b314a9
Author:    Damon Nguyen <dnguyen@openjdk.org>
Committer: Alexander Zuev <kizune@openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/87b314a985c5c3937c1d1d8daadd3e9f8b1acd9d
                
Stats:     238 lines in 3 files changed: 229 ins; 6 del; 3 mod

7093691: Nimbus LAF: disabled JComboBox using renderer has bad font color

Reviewed-by: honkar, kizune, psadhukhan

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic