GUI: fixed wrong clicks from additional mouse buttons (now only left clicks are allowed, closes #11455)

This commit is contained in:
Oleg Agafonov 2023-11-23 09:23:01 +04:00
parent 75958e3710
commit a0ed89035f
17 changed files with 82 additions and 21 deletions

View file

@ -789,11 +789,12 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e)) {
isDragging = true;
beginSelectionDrag(e.getX(), e.getY(), e.isShiftDown());
updateSelectionDrag(e.getX(), e.getY());
if (!SwingUtilities.isLeftMouseButton(e)) {
return;
}
isDragging = true;
beginSelectionDrag(e.getX(), e.getY(), e.isShiftDown());
updateSelectionDrag(e.getX(), e.getY());
}
@Override
@ -973,6 +974,9 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
visibilityButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (!SwingUtilities.isLeftMouseButton(e)) {
return;
}
visPopup.show(e.getComponent(), 0, e.getComponent().getHeight());
}
});
@ -2297,6 +2301,9 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
this.countLabelListener = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (!SwingUtilities.isLeftMouseButton(e)) {
return;
}
JLabel countLabel = (JLabel) e.getComponent();
List<CardView> cards = findCardStackByCountLabel(countLabel);
boolean selected = !cards.isEmpty() && cards.get(0).isSelected();