Browse Source

Explicitly make settings the tooltip of an AttachedPopupComponent a no-op.

pull/235/head
weisj 4 years ago
parent
commit
f691249ae9
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 13
      core/src/main/java/com/github/weisj/darklaf/components/popup/AttachedPopupComponent.java

13
core/src/main/java/com/github/weisj/darklaf/components/popup/AttachedPopupComponent.java

@ -223,8 +223,12 @@ public class AttachedPopupComponent extends JToolTip {
}
protected ToolTipContext createToolTipContext() {
return new ToolTipContext().setAlignment(Alignment.CENTER).setCenterAlignment(Alignment.SOUTH)
.setUseBestFit(true).setToolTipInsets(new Insets(2, 2, 2, 2)).setFallBackPositionProvider(c -> {
return new ToolTipContext()
.setAlignment(Alignment.CENTER)
.setCenterAlignment(Alignment.SOUTH)
.setUseBestFit(true)
.setToolTipInsets(new Insets(2, 2, 2, 2))
.setFallBackPositionProvider(c -> {
Window window = DarkUIUtil.getWindow(c.getTarget());
Dimension size = c.getToolTip().getPreferredSize();
Rectangle bounds = window.getBounds();
@ -233,6 +237,11 @@ public class AttachedPopupComponent extends JToolTip {
});
}
@Override
public void setToolTipText(final String text) {
/* Not supported */
}
@Override
public String getTipText() {
return ToolTipConstants.NO_TEXT;

Loading…
Cancel
Save