Skip to content

Commit

Permalink
tool tip indicator feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Wisser committed Oct 5, 2023
1 parent 19f89a0 commit dac9667
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/gui/net/sf/jailer/ui/UIUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2524,6 +2524,8 @@ private static boolean isToolTipVisible(Window parent) {
return false;
}

private static Runnable resetBorder;

public static void initToolTip(JComponent c, JComponent proxy) {
if (c.getToolTipText() != null && !"no-tt-indicator".equals(c.getName())) {
c.putClientProperty("Popup.forceHeavyWeight", true);
Expand All @@ -2540,7 +2542,6 @@ public static void initToolTip(JComponent c, JComponent proxy) {
indicatorComponent = c;
}
c.addMouseListener(new MouseListener() {
Runnable resetBorder;
Timer timer;

@Override
Expand All @@ -2556,12 +2557,17 @@ public void mouseEntered(MouseEvent e) {
invokeLater(2, () -> {
Border origBorder = indicatorComponent.getBorder();
if (!(origBorder instanceof ToolTipBorder) && !isToolTipVisible(window)) {
if (resetBorder != null && proxy == null) {
resetBorder.run();
}
resetBorder = () -> {
indicatorComponent.setBorder(origBorder);
resetBorder = null;
};
indicatorComponent.setBorder(new ToolTipBorder(origBorder));
Runnable reset = resetBorder;
Runnable reset = () -> {
indicatorComponent.setBorder(origBorder);
};
if (timer != null) {
timer.stop();
}
Expand Down

0 comments on commit dac9667

Please sign in to comment.