From 2b73ce2f5bef08dd28850f6e97614272947af79e 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 --- src/be/nikiroo/utils/ui/ListModel.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/be/nikiroo/utils/ui/ListModel.java b/src/be/nikiroo/utils/ui/ListModel.java index 3029f61a..7103dbac 100644 --- a/src/be/nikiroo/utils/ui/ListModel.java +++ b/src/be/nikiroo/utils/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