mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Hints misbehaviour fix
This commit is contained in:
@@ -50,6 +50,8 @@ public class IdeTooltip extends ComparableObject.Impl {
|
||||
|
||||
private Ui myUi;
|
||||
|
||||
private boolean hint = false;
|
||||
|
||||
|
||||
public IdeTooltip(Component component, Point point, JComponent tipComponent, Object... identity) {
|
||||
super(identity);
|
||||
@@ -232,6 +234,15 @@ public class IdeTooltip extends ComparableObject.Impl {
|
||||
return myLayer;
|
||||
}
|
||||
|
||||
public IdeTooltip setHint(boolean hint) {
|
||||
this.hint = hint;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isHint() {
|
||||
return hint;
|
||||
}
|
||||
|
||||
public boolean isInside(RelativePoint target) {
|
||||
return myUi != null && myUi.isInside(target);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,12 @@ public class IdeTooltipManager implements ApplicationComponent, AWTEventListener
|
||||
if (!myCurrentTipIsCentered) {
|
||||
myX = me.getX();
|
||||
myY = me.getY();
|
||||
maybeShowFor(c, me);
|
||||
if (c instanceof JComponent && ((JComponent)c).getToolTipText(me) == null && (myQueuedTooltip == null || !myQueuedTooltip.isHint())) {
|
||||
hideCurrent(me, null, null);//There is no tooltip or hint here, let's proceed it as MOUSE_EXITED
|
||||
}
|
||||
else {
|
||||
maybeShowFor(c, me);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,8 +166,8 @@ public class LightweightHint extends UserDataHolderBase implements Hint {
|
||||
.setFont(hintHint.getTextFont())
|
||||
.setCalloutShift(hintHint.getCalloutShift())
|
||||
.setPositionChangeShift(hintHint.getPositionChangeX(), hintHint.getPositionChangeY())
|
||||
.setExplicitClose(hintHint.isExplicitClose());
|
||||
|
||||
.setExplicitClose(hintHint.isExplicitClose())
|
||||
.setHint(true);
|
||||
myComponent.validate();
|
||||
myCurrentIdeTooltip = IdeTooltipManager.getInstance().show(tooltip, hintHint.isShowImmediately());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user