mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 23:08:42 +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 ) {
|
public void mousePressed( MouseEvent e ) {
|
||||||
updateRollover( e );
|
updateRollover( e );
|
||||||
|
|
||||||
if( !isPressedTabClose() )
|
if( !isPressedTabClose() && SwingUtilities.isLeftMouseButton(e) )
|
||||||
mouseDelegate.mousePressed( e );
|
mouseDelegate.mousePressed( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2644,7 +2644,7 @@ public class FlatTabbedPaneUI
|
|||||||
|
|
||||||
// check whether mouse hit tab close area
|
// check whether mouse hit tab close area
|
||||||
boolean hitClose = isTabClosable( tabIndex ) && getTabCloseHitArea( tabIndex ).contains( x, y );
|
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;
|
pressedTabIndex = hitClose ? tabIndex : -1;
|
||||||
setRolloverTabClose( hitClose );
|
setRolloverTabClose( hitClose );
|
||||||
setPressedTabClose( hitClose && tabIndex == pressedTabIndex );
|
setPressedTabClose( hitClose && tabIndex == pressedTabIndex );
|
||||||
|
|||||||
Reference in New Issue
Block a user