introduced Component.innerFocusWidth UI default to allow "inner" focus border (e.g. if outer focus border width is zero)

currently zero in all themes because:
- undecided whether it is necessary
- not useful for "Flat IntelliJ" and "Flat Darcula" themes
- focused buttons in "Flat Light" theme already have light blue background
- does not work for components in scrollpanes (e.g. textarea)
This commit is contained in:
Karl Tauber
2019-10-05 11:14:23 +02:00
parent c87f5cb05f
commit 5288e0f54e
4 changed files with 7 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ import javax.swing.text.JTextComponent;
* {@link FlatUIUtils#paintParentBackground} to paint the empty space correctly.
*
* @uiDefault Component.focusWidth int
* @uiDefault Component.innerFocusWidth int
* @uiDefault Component.focusColor Color
* @uiDefault Component.borderColor Color
* @uiDefault Component.disabledBorderColor Color
@@ -59,6 +60,7 @@ public class FlatBorder
extends BasicBorders.MarginBorder
{
protected final int focusWidth = UIManager.getInt( "Component.focusWidth" );
protected final int innerFocusWidth = UIManager.getInt( "Component.innerFocusWidth" );
protected final Color focusColor = UIManager.getColor( "Component.focusColor" );
protected final Color borderColor = UIManager.getColor( "Component.borderColor" );
protected final Color disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" );
@@ -76,7 +78,8 @@ public class FlatBorder
if( isFocused( c ) ) {
g2.setColor( getFocusColor( c ) );
FlatUIUtils.paintOutlineBorder( g2, x, y, width, height, focusWidth, lineWidth, arc );
FlatUIUtils.paintOutlineBorder( g2, x, y, width, height, focusWidth,
lineWidth + scale( (float) innerFocusWidth ), arc );
}
g2.setPaint( getBorderColor( c ) );

View File

@@ -26,6 +26,7 @@ Button.default.boldText=true
#---- Component ----
Component.focusWidth=2
Component.innerFocusWidth=0
Component.arrowType=triangle

View File

@@ -39,6 +39,7 @@ CheckBox.icon.selectedPressedBackground=72A1D4
#---- Component ----
Component.focusWidth=2
Component.innerFocusWidth=0
Component.arrowType=triangle

View File

@@ -103,6 +103,7 @@ ComboBox.padding=2,6,2,6
#---- Component ----
Component.focusWidth=0
Component.innerFocusWidth=0
Component.arc=5
Component.minimumWidth=64
Component.arrowType=chevron