git://git.nikiroo.be
/
fanfix-swing.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f8ad84a
)
ListModel: tooltip/popup interactions
author
Niki Roo
<niki@nikiroo.be>
Fri, 1 May 2020 10:05:31 +0000
(12:05 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Fri, 1 May 2020 10:05:31 +0000
(12:05 +0200)
src/be/nikiroo/utils/ui/ListModel.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/utils/ui/ListModel.java
b/src/be/nikiroo/utils/ui/ListModel.java
index 3029f61a04c43411da2400f5cf6fb75374dc1a81..7103dbac9a911203d92a1677795f481e8d9d07b2 100644
(file)
--- a/
src/be/nikiroo/utils/ui/ListModel.java
+++ b/
src/be/nikiroo/utils/ui/ListModel.java
@@
-275,7
+275,7
@@
public class ListModel<T> extends DefaultListModel6<T> {
hoveredIndex = index;
fireElementChanged(oldIndex);
fireElementChanged(index);
-
+
Window oldTooltip = tooltip;
tooltip = null;
if (oldTooltip != null) {
@@
-298,6
+298,11
@@
public class ListModel<T> extends DefaultListModel6<T> {
return;
}
+ if (popup != null
+ && popup.isShowing()) {
+ return;
+ }
+
tooltip = newTooltip(index, me);
}
});
@@
-340,6
+345,12
@@
public class ListModel<T> extends DefaultListModel6<T> {
list.locationToIndex(e.getPoint()));
}
+ Window oldTooltip = tooltip;
+ tooltip = null;
+ if (oldTooltip != null) {
+ oldTooltip.setVisible(false);
+ }
+
popup.show(list, e.getX(), e.getY());
}
}