mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 22:40:53 +03:00
Switch and close tabs on left mouse click only
This commit is contained in:
@@ -2589,7 +2589,7 @@ public class FlatTabbedPaneUI
|
||||
public void mousePressed( MouseEvent e ) {
|
||||
updateRollover( e );
|
||||
|
||||
if( !isPressedTabClose() )
|
||||
if( !isPressedTabClose() && SwingUtilities.isLeftMouseButton(e) )
|
||||
mouseDelegate.mousePressed( e );
|
||||
}
|
||||
|
||||
@@ -2644,7 +2644,7 @@ public class FlatTabbedPaneUI
|
||||
|
||||
// check whether mouse hit tab close area
|
||||
boolean hitClose = isTabClosable( tabIndex ) && getTabCloseHitArea( tabIndex ).contains( x, y );
|
||||
if( e.getID() == MouseEvent.MOUSE_PRESSED )
|
||||
if( e.getID() == MouseEvent.MOUSE_PRESSED && SwingUtilities.isLeftMouseButton(e) )
|
||||
pressedTabIndex = hitClose ? tabIndex : -1;
|
||||
setRolloverTabClose( hitClose );
|
||||
setPressedTabClose( hitClose && tabIndex == pressedTabIndex );
|
||||
|
||||
Reference in New Issue
Block a user