Skip to content
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

JToolTip does not respect their location #468

Closed
juersimon opened this issue Jan 19, 2022 · 2 comments
Closed

JToolTip does not respect their location #468

juersimon opened this issue Jan 19, 2022 · 2 comments
Milestone

Comments

@juersimon
Copy link

juersimon commented Jan 19, 2022

As already noted in #188, the position of tooltips is not respected if they cover the component. The correction made only works if the tooltip was not created by the ToolTipManager. The test case included in #188 uses a somewhat unusual way of positioning the tooltip. More commonly, the position of the tooltip might be adjusted by overriding the getToolTipLocation method in JComponent. In this case the change has no effect.
I suggest to define another property in FlatClientProperties:

String POPUP_DISABLE_FIX_LOCATION = "Popup.disableFixLocation";

And to check this in FlatPopupFactory:

@Override
public Popup getPopup( Component owner, Component contents, int x, int y )
    throws IllegalArgumentException
{
    if (!isOptionEnabled(owner, contents, FlatClientProperties.POPUP_DISABLE_FIX_LOCATION, "Popup.disableFixLocation")) {
        Point pt = fixToolTipLocation( owner, contents, x, y );
...

I have adapted the test case accordingly.
FlatLafToolTip.zip

@DevCharly
Copy link
Collaborator

Thanks for pointing out this issue.

This is actually a bug and no additional option should be needed to fix a bug...

DevCharly added a commit that referenced this issue Jan 24, 2022
…ent.getToolTipLocation()` and wants place tooltip under mouse location (issue #468)
@DevCharly
Copy link
Collaborator

Should be fixed in latest 2.0.1-SNAPSHOT https://github.com/JFormDesigner/FlatLaf#snapshots

Please give it a try

@DevCharly DevCharly added this to the 2.0.1 milestone Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants