Skip to content

Commit

Permalink
Close tabs by middle-clicking them
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbraginskiy committed Jan 7, 2025
1 parent fef0bbc commit f4991ab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions megameklab/src/megameklab/ui/MegaMekLabTabbedUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,18 @@ public void mouseClicked(MouseEvent e) {
}
}
});

addMouseListener(
new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// middle click to close tab
if (e.getButton() == MouseEvent.BUTTON2 && editor.safetyPrompt()) {
closeTabAt(editors.indexOf(editor));
}
}
}
);
}
}

Expand Down

0 comments on commit f4991ab

Please sign in to comment.