Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

8251377: [macos11] JTabbedPane selected tab text is barely legible #65

Closed
wants to merge 2 commits into from

Conversation

prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Dec 23, 2020

Please review a fix for jdk16.
On macOS 11 (bigsur), using the Swing Aqua Look and Feel, the text of the selected JTabbedPane tab title text is just a light gray outline of white text on a white background. The macOS 11 design inverted from dark background / light text to light background / dark text, so white text on white background is not legible.
Correct system color to use for this scenario, as per Apple, is [NSColor controlTextColor]
so the proposed fix is to use this system color for BigSur.
For preBigSur releases, "white" is still used as the above color is for text color but the tabPane background color is still not readable through any Apple API, so [NSColor controlTextColor] which returns black will not be legible on preBigSur releases which has black background.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8251377: [macos11] JTabbedPane selected tab text is barely legible

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk16 pull/65/head:pull/65
$ git checkout pull/65

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 23, 2020

👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 23, 2020
@openjdk
Copy link

openjdk bot commented Dec 23, 2020

@prsadhuk The following labels will be automatically applied to this pull request:

  • 2d
  • awt
  • swing

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added 2d 2d-dev@openjdk.java.net swing swing-dev@openjdk.java.net awt awt-dev@openjdk.java.net labels Dec 23, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 23, 2020

Webrevs

@prsadhuk
Copy link
Contributor Author

/label remove 2d

@prsadhuk
Copy link
Contributor Author

/label remove awt

@openjdk openjdk bot removed the 2d 2d-dev@openjdk.java.net label Dec 23, 2020
@openjdk
Copy link

openjdk bot commented Dec 23, 2020

@prsadhuk
The 2d label was successfully removed.

@openjdk openjdk bot removed the awt awt-dev@openjdk.java.net label Dec 23, 2020
@openjdk
Copy link

openjdk bot commented Dec 23, 2020

@prsadhuk
The awt label was successfully removed.

@@ -869,7 +870,7 @@ public Object createValue(UIDefaults defaultsTable) {
"TabbedPane.tabsOverlapBorder", Boolean.TRUE,
"TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor,
"TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor,
"TabbedPane.selectedTabTitleNormalColor", selectedTabTitleNormalColor,
"TabbedPane.selectedTabTitleNormalColor", System.getProperty("os.version").contains("10.16") ? selectedControlTextColor : selectedTabTitleNormalColor,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't look very robust. What will happen on the next version of macOS ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for BigSur and above is added

@mlbridge
Copy link

mlbridge bot commented Dec 24, 2020

Mailing list message from Alan Snyder on swing-dev:

What alternative are you proposing? I don?t believe there is any option that is guaranteed not to require changing
for some future release of macOS without some new API from Apple, e.g. ?selectedTabTextColor?.

@prrace
Copy link
Contributor

prrace commented Dec 24, 2020

Mailing list message from Alan Snyder on swing-dev:

What alternative are you proposing? I don?t believe there is any option that is guaranteed not to require changing
for some future release of macOS without some new API from Apple, e.g. ?selectedTabTextColor?.

Alan,
We contacted Apple and this is their recommendation since there is no way to future-proof it.

@prsadhuk
Copy link
Contributor Author

Headful jtreg and jck tests have passed.

@openjdk
Copy link

openjdk bot commented Dec 24, 2020

@prsadhuk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8251377: [macos11] JTabbedPane selected tab text is barely legible

Reviewed-by: prr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 12 new commits pushed to the master branch:

  • e2aa724: 8258941: Test specify the Classpath exception in the header
  • c398a82: 8258916: javac/doclint reports broken HTML on multiline mailto links
  • 23b83c5: 8253954: javac crash when compiling code with enhanced switch expressions with option -Xjcov
  • 8b37c2c: 8257468: runtime/whitebox/TestWBDeflateIdleMonitors.java fails with Monitor should be deflated.: expected true to equal false
  • 9cd8e38: 8257521: runtime/logging/MonitorInflationTest.java crashed in MonitorList::unlink_deflated
  • 61e5e39: 8258832: ProblemList com/sun/jdi/AfterThreadDeathTest.java on Linux-X64
  • eabc903: 8258827: ProblemList Naming/DefaultRegistryPort.java and Naming/legalRegistryNames/LegalRegistryNames.java on Windows
  • 88dd6a9: 8258802: ProblemList TestJstatdDefaults.java, TestJstatdRmiPort.java, and TestJstatdServer.java
  • 772addf: 8258790: C2: Crash on empty macro node list
  • 8da7c58: 8258443: doclint should be service-loaded with system class loader
  • ... and 2 more: https://git.openjdk.java.net/jdk16/compare/e680ebeb2f3c850a1c737923fe1abc3e3f0846f2...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 24, 2020
@prsadhuk
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Dec 24, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 24, 2020
@openjdk
Copy link

openjdk bot commented Dec 24, 2020

@prsadhuk Since your change was applied there have been 12 commits pushed to the master branch:

  • e2aa724: 8258941: Test specify the Classpath exception in the header
  • c398a82: 8258916: javac/doclint reports broken HTML on multiline mailto links
  • 23b83c5: 8253954: javac crash when compiling code with enhanced switch expressions with option -Xjcov
  • 8b37c2c: 8257468: runtime/whitebox/TestWBDeflateIdleMonitors.java fails with Monitor should be deflated.: expected true to equal false
  • 9cd8e38: 8257521: runtime/logging/MonitorInflationTest.java crashed in MonitorList::unlink_deflated
  • 61e5e39: 8258832: ProblemList com/sun/jdi/AfterThreadDeathTest.java on Linux-X64
  • eabc903: 8258827: ProblemList Naming/DefaultRegistryPort.java and Naming/legalRegistryNames/LegalRegistryNames.java on Windows
  • 88dd6a9: 8258802: ProblemList TestJstatdDefaults.java, TestJstatdRmiPort.java, and TestJstatdServer.java
  • 772addf: 8258790: C2: Crash on empty macro node list
  • 8da7c58: 8258443: doclint should be service-loaded with system class loader
  • ... and 2 more: https://git.openjdk.java.net/jdk16/compare/e680ebeb2f3c850a1c737923fe1abc3e3f0846f2...master

Your commit was automatically rebased without conflicts.

Pushed as commit 3f67afd.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@@ -870,7 +870,7 @@ public Object createValue(UIDefaults defaultsTable) {
"TabbedPane.tabsOverlapBorder", Boolean.TRUE,
"TabbedPane.selectedTabTitlePressedColor", selectedTabTitlePressedColor,
"TabbedPane.selectedTabTitleDisabledColor", selectedTabTitleDisabledColor,
"TabbedPane.selectedTabTitleNormalColor", System.getProperty("os.version").contains("10.16") ? selectedControlTextColor : selectedTabTitleNormalColor,
"TabbedPane.selectedTabTitleNormalColor", JRSUIUtils.isMacOSXBigSurOrAbove() ? selectedControlTextColor : selectedTabTitleNormalColor,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess an intention was to use the JRSUIUtils.isBigSurOrAbove field not the JRSUIUtils.isMacOSXBigSurOrAbove() method, otherwise, why did you add it.

@prsadhuk prsadhuk deleted the JDK16-8251377 branch January 5, 2021 08:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integrated Pull request has been integrated swing swing-dev@openjdk.java.net
3 participants