Skip to content

6875229: Wrong placement of icons in JTabbedPane in Nimbus#14596

Closed
prsadhuk wants to merge 6 commits into
openjdk:masterfrom
prsadhuk:JDK-6875229
Closed

6875229: Wrong placement of icons in JTabbedPane in Nimbus#14596
prsadhuk wants to merge 6 commits into
openjdk:masterfrom
prsadhuk:JDK-6875229

Conversation

@prsadhuk

@prsadhuk prsadhuk commented Jun 21, 2023

Copy link
Copy Markdown
Contributor

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
image

After fix
image


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-6875229: Wrong placement of icons in JTabbedPane in Nimbus (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14596/head:pull/14596
$ git checkout pull/14596

Update a local copy of the PR:
$ git checkout pull/14596
$ git pull https://git.openjdk.org/jdk.git pull/14596/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14596

View PR using the GUI difftool:
$ git pr show -t 14596

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14596.diff

Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jun 21, 2023

Copy link
Copy Markdown

👋 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 commented Jun 21, 2023

Copy link
Copy Markdown

⚠️ @prsadhuk This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 21, 2023
@openjdk

openjdk Bot commented Jun 21, 2023

Copy link
Copy Markdown

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

  • client

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

@openjdk openjdk Bot added the client client-libs-dev@openjdk.org label Jun 21, 2023
@mlbridge

mlbridge Bot commented Jun 21, 2023

Copy link
Copy Markdown

Webrevs

@honkar-jdk honkar-jdk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix looks good.

Minor changes: Copyright year needs to be updated for src file and unused imports can be removed from the test.

Comment on lines +655 to +659
paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
paintText(ss, g, tabPlacement, font, metrics,
tabIndex, clippedTitle, textRect, isSelected);

paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the purpose of moving this line? Doesn't seem to change anything from what I've tested so far.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@prsadhuk Is there any change in rendering based on what we draw first?

@kumarabhi006 kumarabhi006 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

@jayathirthrao jayathirthrao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Change looks good to me, except for a small query i have.
Test runs fine with & without fix.

Comment on lines +655 to +659
paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
paintText(ss, g, tabPlacement, font, metrics,
tabIndex, clippedTitle, textRect, isSelected);

paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@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() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@openjdk

openjdk Bot commented Jul 4, 2023

Copy link
Copy Markdown

@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:

6875229: Wrong placement of icons in JTabbedPane in Nimbus

Reviewed-by: honkar, abhiscxk, dnguyen, jdv

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 master branch:

  • 711cddd: 8311249: Remove unused MemAllocator::obj_memory_range
  • 514816e: 8309889: [s390] Missing return statement after calling jump_to_native_invoker method in generate_method_handle_dispatch.
  • 60544f9: 8309894: compiler/vectorapi/VectorLogicalOpIdentityTest.java fails on SVE system with UseSVE=0
  • 0916e6a: 8311092: Please disable runtime/jni/nativeStack/TestNativeStack.java on armhf
  • d8a0121: 8311109: tautological-compare warning in awt_Win32GraphicsDevice.cpp
  • b9198f9: 8254566: Clarify the spec of ClassLoader::getClassLoadingLock for non-parallel capable loader
  • f393975: 8310743: assert(reserved_rgn != nullptr) failed: Add committed region, No reserved region found
  • ba974d5: 8310661: JFR: Replace JVM.getJVM() with JVM
  • 496f94b: 8311086: Remove jtreg/gc/startup_warnings
  • 9d2e0b2: 8307934: JRobot.moveMouseTo must access component on EDT
  • ... and 286 more: https://git.openjdk.org/jdk/compare/4d4706967d44b6908406818bb135f94130f373a0...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 Jul 4, 2023
@prsadhuk

prsadhuk commented Jul 7, 2023

Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk

openjdk Bot commented Jul 7, 2023

Copy link
Copy Markdown

Going to push as commit 6485b7d.
Since your change was applied there have been 319 commits pushed to the master branch:

  • 27de536: 8311581: Remove obsolete code and comments in TestLVT.java
  • e848d94: 8310923: Refactor Currency tests to use JUnit
  • 0c86c31: 8302351: "assert(!JavaThread::current()->is_interp_only_mode() || !nm->method()->is_continuation_enter_intrinsic() || ContinuationEntry::is_interpreted_call(return_pc)) failed: interp_only_mode but not in enterSpecial interpreted entry" in fixup_callers_callsite
  • ec7da91: 8240567: MethodTooLargeException thrown while creating a jlink image
  • 97e99f0: 8311087: PhiNode::wait_for_region_igvn should break early
  • 7173c30: 8307766: Linux: Provide the option to override the timer slack
  • 356067d: 8311489: Remove unused dirent_md files
  • 3d813ae: 8311301: MethodExitTest may fail with stack buffer overrun
  • 0741cd3: 8311264: JavaDoc index comparator is not transitive
  • edb2be1: 8311279: TestStressIGVNAndCCP.java failed with different IGVN traces for the same seed
  • ... and 309 more: https://git.openjdk.org/jdk/compare/4d4706967d44b6908406818bb135f94130f373a0...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Jul 7, 2023
@openjdk openjdk Bot closed this Jul 7, 2023
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 7, 2023
@openjdk

openjdk Bot commented Jul 7, 2023

Copy link
Copy Markdown

@prsadhuk Pushed as commit 6485b7d.

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

@prsadhuk prsadhuk deleted the JDK-6875229 branch July 7, 2023 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants