mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 06:50:56 +03:00
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:
@@ -48,6 +48,7 @@ import javax.swing.text.JTextComponent;
|
|||||||
* {@link FlatUIUtils#paintParentBackground} to paint the empty space correctly.
|
* {@link FlatUIUtils#paintParentBackground} to paint the empty space correctly.
|
||||||
*
|
*
|
||||||
* @uiDefault Component.focusWidth int
|
* @uiDefault Component.focusWidth int
|
||||||
|
* @uiDefault Component.innerFocusWidth int
|
||||||
* @uiDefault Component.focusColor Color
|
* @uiDefault Component.focusColor Color
|
||||||
* @uiDefault Component.borderColor Color
|
* @uiDefault Component.borderColor Color
|
||||||
* @uiDefault Component.disabledBorderColor Color
|
* @uiDefault Component.disabledBorderColor Color
|
||||||
@@ -59,6 +60,7 @@ public class FlatBorder
|
|||||||
extends BasicBorders.MarginBorder
|
extends BasicBorders.MarginBorder
|
||||||
{
|
{
|
||||||
protected final int focusWidth = UIManager.getInt( "Component.focusWidth" );
|
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 focusColor = UIManager.getColor( "Component.focusColor" );
|
||||||
protected final Color borderColor = UIManager.getColor( "Component.borderColor" );
|
protected final Color borderColor = UIManager.getColor( "Component.borderColor" );
|
||||||
protected final Color disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" );
|
protected final Color disabledBorderColor = UIManager.getColor( "Component.disabledBorderColor" );
|
||||||
@@ -76,7 +78,8 @@ public class FlatBorder
|
|||||||
|
|
||||||
if( isFocused( c ) ) {
|
if( isFocused( c ) ) {
|
||||||
g2.setColor( getFocusColor( 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 ) );
|
g2.setPaint( getBorderColor( c ) );
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ Button.default.boldText=true
|
|||||||
#---- Component ----
|
#---- Component ----
|
||||||
|
|
||||||
Component.focusWidth=2
|
Component.focusWidth=2
|
||||||
|
Component.innerFocusWidth=0
|
||||||
Component.arrowType=triangle
|
Component.arrowType=triangle
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ CheckBox.icon.selectedPressedBackground=72A1D4
|
|||||||
#---- Component ----
|
#---- Component ----
|
||||||
|
|
||||||
Component.focusWidth=2
|
Component.focusWidth=2
|
||||||
|
Component.innerFocusWidth=0
|
||||||
Component.arrowType=triangle
|
Component.arrowType=triangle
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ ComboBox.padding=2,6,2,6
|
|||||||
#---- Component ----
|
#---- Component ----
|
||||||
|
|
||||||
Component.focusWidth=0
|
Component.focusWidth=0
|
||||||
|
Component.innerFocusWidth=0
|
||||||
Component.arc=5
|
Component.arc=5
|
||||||
Component.minimumWidth=64
|
Component.minimumWidth=64
|
||||||
Component.arrowType=chevron
|
Component.arrowType=chevron
|
||||||
|
|||||||
Reference in New Issue
Block a user