RFR: 8075917: The regression-swing case failed as the text on label is not painted red with the GTK L&F [v5]
Abhishek Kumar
abhiscxk at openjdk.org
Wed Mar 6 08:59:48 UTC 2024
On Wed, 6 Mar 2024 08:43:26 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>>> Also, the enabled state are still not handled
>>
>> The enabled state is not handled in Metal LAF also, tried adding the enabledText property by setting ui property --
>> `UIManager.getDefaults().put("CheckBox.enabledText", checkboxColor);`
>>
>> but the checkbox/radiobutton is painted with default black color.
>> Should we handle the change in metal LAF as well?
>
> Backtracking a bit, regarding `Label.foreground` why it needs to be done here?
>
> Other L&F, it is added in corresponding LookAndFeel class
> for example, in [Metal](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java#L1001)
> and in [Windows](https://github.com/openjdk/jdk/blob/master/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java#L880)
> etc
> so I think it is needed to be added in GTKLookAndFeel class
>
> and additionally there is setting of `Label.foreground` and other Label. property in BasicLabelUI.java [installDefaults](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java#L368)
> but we dont do it for Nimbus or GTK or Synth so I guess we need to call `super.installDefaults(c)` in SynthLabelUI class since there is no GTKLabelUI class
> or
> maybe do
> `LookAndFeel.installColorsAndFont(c, "Label.background", "Label.foreground", "Label.font");` alone to avoid other properties being set and to not fallback
>
> Please check if it will work
> and if it does, then we need to employ similar for checbox/radiobutton/togglebutton
I will check and update.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17763#discussion_r1514070177
More information about the client-libs-dev
mailing list