Merge pull request #492 from dozmus/features/fix-right-click-close
fix right-clicking close tab button closes popup menu
This commit is contained in:
commit
0d8206ea46
|
@ -6,6 +6,7 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
|
|||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
public class CloseButtonComponent extends JPanel {
|
||||
|
||||
|
@ -45,6 +46,9 @@ public class CloseButtonComponent extends JPanel {
|
|||
|
||||
button.addMouseListener(new MouseClickedListener(e ->
|
||||
{
|
||||
if (e.getButton() != MouseEvent.BUTTON1) // left-click
|
||||
return;
|
||||
|
||||
if (pane.indexOfTabComponent(CloseButtonComponent.this) != -1)
|
||||
pane.remove(pane.indexOfTabComponent(CloseButtonComponent.this));
|
||||
}));
|
||||
|
|
Loading…
Reference in New Issue
Block a user