Merge pull request #9008 from Nightfirecat/fix-plugin-list-color-bug
PluginListItem: Reset label color on popup menu item click
This commit is contained in:
@@ -317,10 +317,14 @@ class PluginListItem extends JPanel
|
||||
static void addLabelPopupMenu(final JLabel label, final Collection<JMenuItem> menuItems)
|
||||
{
|
||||
final JPopupMenu menu = new JPopupMenu();
|
||||
final Color labelForeground = label.getForeground();
|
||||
menu.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
|
||||
for (final JMenuItem menuItem : menuItems)
|
||||
{
|
||||
// Some machines register mouseEntered through a popup menu, and do not register mouseExited when a popup
|
||||
// menu item is clicked, so reset the label's color when we click one of these options.
|
||||
menuItem.addActionListener(e -> label.setForeground(labelForeground));
|
||||
menu.add(menuItem);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user