Browse Source

Ensure custom tooltip position is set after all other changes to its location.

pull/188/head
weisj 5 years ago
parent
commit
a42f4bbbaa
  1. 7
      core/src/main/java/com/github/weisj/darklaf/ui/tooltip/ToolTipUtil.java

7
core/src/main/java/com/github/weisj/darklaf/ui/tooltip/ToolTipUtil.java

@ -178,11 +178,8 @@ public class ToolTipUtil {
Window window = DarkUIUtil.getWindow(toolTip);
if (window == null) return;
Point p = new Point(x, y);
Window targetWindow = DarkUIUtil.getWindow(target);
p = SwingUtilities.convertPoint(target, p, targetWindow);
Point windowPos = targetWindow.getLocation();
p.x += windowPos.x;
p.y += windowPos.y;
SwingUtilities.convertPointToScreen(p, target);
window.setLocation(p);
SwingUtilities.invokeLater(() -> window.setLocation(p));
}
}

Loading…
Cancel
Save