mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 23:07:15 -06:00
List, Table and Tree: item selection color of focused components no longer change from blue to gray when temporary loosing focus (e.g. showing a popup menu)
This commit is contained in:
@@ -106,7 +106,7 @@ public class FlatListUI
|
||||
@Override
|
||||
public void focusLost( FocusEvent e ) {
|
||||
super.focusLost( e );
|
||||
toggleSelectionColors( false );
|
||||
toggleSelectionColors( e.isTemporary() );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class FlatTableUI
|
||||
@Override
|
||||
public void focusLost( FocusEvent e ) {
|
||||
super.focusLost( e );
|
||||
toggleSelectionColors( false );
|
||||
toggleSelectionColors( e.isTemporary() );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Insets;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
@@ -221,7 +222,7 @@ public class FlatTreeUI
|
||||
TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf )
|
||||
{
|
||||
boolean isEditing = (editingComponent != null && editingRow == row);
|
||||
boolean hasFocus = tree.hasFocus();
|
||||
boolean hasFocus = (KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner() == tree);
|
||||
boolean cellHasFocus = hasFocus && (row == getLeadSelectionRow());
|
||||
boolean isSelected = tree.isRowSelected( row );
|
||||
boolean isDropRow = isDropRow( row );
|
||||
|
||||
Reference in New Issue
Block a user