RFR: 8261221: Tooltip bigger than screen size blinks - shows and hides over and over again
Kevin Rushforth
kcr at openjdk.java.net
Wed Feb 17 18:53:46 UTC 2021
On Fri, 5 Feb 2021 10:46:49 GMT, Paweł Kruszczyński <github.com+3855776+xardif at openjdk.org> wrote:
> `Tooltip` is no longer hiding upon receiving `MouseEvent.MOUSE_ENTERED_TARGET` event inside it. Pressing mouse on overlaying tooltip also kills the tooltip, so the infinite duration tooltip can be closed.
I'll review and test it later. This will need a unit test (or system test if a unit test is infeasible). I also left a minor formatting comment below.
modules/javafx.controls/src/main/java/javafx/scene/control/Tooltip.java line 1034:
> 1032: */
> 1033: private EventHandler<MouseEvent> LEAVING_HANDLER = (MouseEvent event) -> {
> 1034: if( mouseInsideTooltip )
Can you reformat this to follow our code style guidelines? Add a space after the `if`, remove the spaces after `(` and before `)`, and move the opening `{` to the same line as the `if`.
modules/javafx.controls/src/main/java/javafx/scene/control/Tooltip.java line 1095:
> 1093: node.addEventHandler(MouseEvent.MOUSE_EXITED, LEAVING_HANDLER);
> 1094: node.addEventHandler(MouseEvent.MOUSE_PRESSED, KILL_HANDLER);
> 1095: t.addEventFilter( MouseEvent.MOUSE_ENTERED_TARGET, TOOLTIP_MOUSE_ENTERED );
Code style: remove spaces after `(` and before `)` here and similar method calls elsewhere.
-------------
PR: https://git.openjdk.java.net/jfx/pull/395
More information about the openjfx-dev
mailing list