6875229: Wrong placement of icons in JTabbedPane in Nimbus#14596
6875229: Wrong placement of icons in JTabbedPane in Nimbus#14596prsadhuk wants to merge 6 commits into
Conversation
This reverts commit d52de28.
|
👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into |
|
|
honkar-jdk
left a comment
There was a problem hiding this comment.
Fix looks good.
Minor changes: Copyright year needs to be updated for src file and unused imports can be removed from the test.
| paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); | ||
| paintText(ss, g, tabPlacement, font, metrics, | ||
| tabIndex, clippedTitle, textRect, isSelected); | ||
|
|
||
| paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); | ||
|
|
There was a problem hiding this comment.
What's the purpose of moving this line? Doesn't seem to change anything from what I've tested so far.
There was a problem hiding this comment.
@prsadhuk Is there any change in rendering based on what we draw first?
| paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); | ||
| paintText(ss, g, tabPlacement, font, metrics, | ||
| tabIndex, clippedTitle, textRect, isSelected); | ||
|
|
||
| paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); | ||
|
|
There was a problem hiding this comment.
@prsadhuk Is there any change in rendering based on what we draw first?
| static volatile Point pt; | ||
| static volatile Rectangle bounds; | ||
| private static void addTab(JTabbedPane aTabbedPane, int anIndex) { | ||
| aTabbedPane.addTab("\u2588", new Icon() { |
There was a problem hiding this comment.
First time i saw usage of Full block character for title and it took some time for me to understand this, unique way to find difference and read color.
There was a problem hiding this comment.
Is there any change in rendering based on what we draw first?
No, since we rely on iconRect and textRect which has its own x and y set so no matter is what called first, it will draw at its own set position
|
@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: 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 296 new commits pushed to the
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 |
|
/integrate |
|
Going to push as commit 6485b7d.
Your commit was automatically rebased without conflicts. |
Icon is placed after text in JTabbedPane for NimbusL&F since the text is drawn at LEADING position instead of TRAILING as is done for other L&F
Before fix

After fix

Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14596/head:pull/14596$ git checkout pull/14596Update a local copy of the PR:
$ git checkout pull/14596$ git pull https://git.openjdk.org/jdk.git pull/14596/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14596View PR using the GUI difftool:
$ git pr show -t 14596Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14596.diff
Webrev
Link to Webrev Comment