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:
Konloch 2024-04-08 19:13:38 -07:00 committed by GitHub
commit 0d8206ea46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

AI 샘플 코드 생성 중입니다

Loading...

View File

@ -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));
}));