On Mon, 23 Aug 2021 12:32:20 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
> It is seen that if a JTabbedPane is unfocused, it's title is painted with
> **white** text on grey background
> as opposed to **black** text on grey background in unfoucsed native app on
> macOSX Catalina
> and is somewhat not legible.
> This can be seen with SwingSet2 demo with InternalFrame or JTabbedPane demo
> and any native app, making focus toggle between the two.
>
> Issue was TabbedPane always draw with "selectedTabTitleNormalColor" which is
> white. Although Aqua L&F defined selectedTabTitleDisabledColor but it is not
> used as TabbedPane does not check if focus is there in current frame and draw
> accordingly, which native app does.
>
> Proposed fix is to check for frame is active or not and draw text color
> accordingly.
> Since it is not affecting BigSur (where even if native app active or not text
> is always drawn in same color), it is only restricted to Catalina and lower.
src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneContrastUI.java
line 83:
> 81: if (enabled && pressed) {
> 82: return
> UIManager.getColor("TabbedPane.selectedTabTitlePressedColor");
> 83: } else if (!enabled || (!JRSUIUtils.isMacOSXBigSurOrAbove() &&
> !isFrameActive)) {
Do we enter this condition in BigSur when SwingSet2 is not focused?
If yes, Will we not see difference in color between "new ColorUIResource(new
Color(1, 1, 1, 0.55f))" and updated "black" color ?
If no, In BigSur from where black color is picked for
selectedTabTitleDisabledColor?
-------------
PR: https://git.openjdk.java.net/jdk/pull/5217