make component outline border wider if focus width is zero

This commit is contained in:
Karl Tauber
2020-05-17 17:59:26 +02:00
parent 531bb2a968
commit 1aa339de02
6 changed files with 9 additions and 1 deletions

View File

@@ -69,6 +69,7 @@ public class FlatBorder
{
protected final int focusWidth = UIManager.getInt( "Component.focusWidth" );
protected final float innerFocusWidth = FlatUIUtils.getUIFloat( "Component.innerFocusWidth", 0 );
protected final float innerOutlineWidth = FlatUIUtils.getUIFloat( "Component.innerOutlineWidth", 0 );
protected final Color focusColor = UIManager.getColor( "Component.focusColor" );
protected final Color borderColor = UIManager.getColor( "Component.borderColor" );
protected final Color disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" );
@@ -93,7 +94,9 @@ public class FlatBorder
Color outlineColor = getOutlineColor( c );
if( outlineColor != null || isFocused( c ) ) {
float innerFocusWidth = !(c instanceof JScrollPane) ? this.innerFocusWidth : 0;
float innerFocusWidth = !(c instanceof JScrollPane)
? (outlineColor != null ? innerOutlineWidth : this.innerFocusWidth)
: 0;
g2.setColor( (outlineColor != null) ? outlineColor : getFocusColor( c ) );
FlatUIUtils.paintComponentOuterBorder( g2, x, y, width, height, focusWidth,

View File

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

View File

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

View File

@@ -185,6 +185,7 @@ ComboBox.padding=2,6,2,6
Component.focusWidth=0
Component.innerFocusWidth={float}0.5
Component.innerOutlineWidth={float}1
Component.arc=5
Component.minimumWidth=64
Component.arrowType=chevron