From ae474ca4ecdbbb4fbf45712cd650f99f91de649f Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Fri, 1 May 2020 12:05:31 +0200 Subject: [PATCH] ListModel: tooltip/popup interactions --- ui/ListModel.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/ListModel.java b/ui/ListModel.java index 3029f61a..7103dbac 100644 --- a/ui/ListModel.java +++ b/ui/ListModel.java @@ -275,7 +275,7 @@ public class ListModel extends DefaultListModel6 { hoveredIndex = index; fireElementChanged(oldIndex); fireElementChanged(index); - + Window oldTooltip = tooltip; tooltip = null; if (oldTooltip != null) { @@ -298,6 +298,11 @@ public class ListModel extends DefaultListModel6 { return; } + if (popup != null + && popup.isShowing()) { + return; + } + tooltip = newTooltip(index, me); } }); @@ -340,6 +345,12 @@ public class ListModel extends DefaultListModel6 { list.locationToIndex(e.getPoint())); } + Window oldTooltip = tooltip; + tooltip = null; + if (oldTooltip != null) { + oldTooltip.setVisible(false); + } + popup.show(list, e.getX(), e.getY()); } } -- 2.27.0