-
Notifications
You must be signed in to change notification settings - Fork 512
8228363: ContextMenu.show with side=TOP does not work the first time in the presence of CSS #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
By using the collection itself as synchronization lock we achieve behaviour that matches java.util.Collections classes.
…/iterating Whitespace fixes.
Pull in changes from main repo
…in the presence of CSS By using the anchor location facility of PopupWindows we can avoid miscalculation of the menu's height entirely. This fix also cleans up some documentation issues. This fix introduces tests that check the correct positioning (test_position_*) test_position_withCSS reproduces the problem that is fixed with this patch. The other test_position_* cases serve as "proof" that no regressions are introduces. They work before and after the fix is introduced.
👋 Welcome back rlichten! A progress list of the required criteria for merging this PR into |
Webrevs
|
/reviewers 2 |
@kevinrushforth |
I saw your comment in #381 regarding the removed section of API docs. We can discuss it as part of the review of this PR. I'll take a look and see whether simply removing it is fine or if I can suggest a replacement. It still might need a CSR (I'll let you know), but it would be a simple one to record the doc changes. |
This approach looks good to me, and it makes it simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to test this, but the approach looks good. I left a few inline comments.
modules/javafx.controls/src/main/java/javafx/scene/control/ContextMenu.java
Show resolved
Hide resolved
modules/javafx.controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java
Outdated
Show resolved
Hide resolved
…in the presence of CSS Corrections as per Kevin Rushforth's comments. Also added two more test cases that test right-to-left node orientation. Fixed the implementation and the API documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix and the tests look good to me. I have one comment on the docs (and I left a minor formatting comment).
modules/javafx.controls/src/main/java/javafx/scene/control/ContextMenu.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/main/java/javafx/scene/control/ContextMenu.java
Outdated
Show resolved
Hide resolved
…in the presence of CSS Removed node orientation from API doc. Removed extra blank lines.
modules/javafx.controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java
Outdated
Show resolved
Hide resolved
@@ -280,6 +309,7 @@ public void show(Node anchor, double screenX, double screenY) { | |||
if (anchor == null) return; | |||
if (getItems().size() == 0) return; | |||
getScene().setNodeOrientation(anchor.getEffectiveNodeOrientation()); | |||
setAnchorLocation(AnchorLocation.CONTENT_TOP_LEFT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to handle RTL case here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
At least we didn't handle the RTL case here until now. The call to setAnchorLocation(AnchorLocation.CONTENT_TOP_LEFT); is only neccessary to "reset" the anchor location in case we called show with a Side before.
…in the presence of CSS Removed unnecessary imports.
@effad 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 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kevinrushforth, @aghaisas) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
/sponsor |
@kevinrushforth @effad Since your change was applied there have been 2 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 6c1a0ca. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
By using the anchor location facility of PopupWindows we can avoid miscalculation of the
menu's height entirely.
This fix also cleans up some documentation issues.
This fix introduces tests that check the correct positioning (test_position_)
test_position_withCSS reproduces the problem that is fixed with this patch.
The other test_position_ cases serve as "proof" that no regressions are introduces.
They work before and after the fix is introduced.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jfx pull/383/head:pull/383
$ git checkout pull/383