default arrow type changed from "triangle" to "chevron" (does not change any theme)

This commit is contained in:
Karl Tauber
2020-11-05 18:55:08 +01:00
parent 082e5842d0
commit 642583479f
11 changed files with 20 additions and 15 deletions

View File

@@ -27,7 +27,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**
* "ascendingSort" icon for {@link javax.swing.table.JTableHeader}. * "ascendingSort" icon for {@link javax.swing.table.JTableHeader}.
* *
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault Table.sortIconColor Color * @uiDefault Table.sortIconColor Color
* *
* @author Karl Tauber * @author Karl Tauber
@@ -35,7 +35,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
public class FlatAscendingSortIcon public class FlatAscendingSortIcon
extends FlatAbstractIcon extends FlatAbstractIcon
{ {
protected final boolean chevron = "chevron".equals( UIManager.getString( "Component.arrowType" ) ); protected final boolean chevron = FlatUIUtils.isChevron( UIManager.getString( "Component.arrowType" ) );
protected final Color sortIconColor = UIManager.getColor( "Table.sortIconColor" ); protected final Color sortIconColor = UIManager.getColor( "Table.sortIconColor" );
public FlatAscendingSortIcon() { public FlatAscendingSortIcon() {

View File

@@ -27,7 +27,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**
* "descendingSort" icon for {@link javax.swing.table.JTableHeader}. * "descendingSort" icon for {@link javax.swing.table.JTableHeader}.
* *
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault Table.sortIconColor Color * @uiDefault Table.sortIconColor Color
* *
* @author Karl Tauber * @author Karl Tauber
@@ -35,7 +35,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
public class FlatDescendingSortIcon public class FlatDescendingSortIcon
extends FlatAbstractIcon extends FlatAbstractIcon
{ {
protected final boolean chevron = "chevron".equals( UIManager.getString( "Component.arrowType" ) ); protected final boolean chevron = FlatUIUtils.isChevron( UIManager.getString( "Component.arrowType" ) );
protected final Color sortIconColor = UIManager.getColor( "Table.sortIconColor" ); protected final Color sortIconColor = UIManager.getColor( "Table.sortIconColor" );
public FlatDescendingSortIcon() { public FlatDescendingSortIcon() {

View File

@@ -28,7 +28,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**
* "arrow" icon for {@link javax.swing.JMenu}. * "arrow" icon for {@link javax.swing.JMenu}.
* *
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault Menu.icon.arrowColor Color * @uiDefault Menu.icon.arrowColor Color
* @uiDefault Menu.icon.disabledArrowColor Color * @uiDefault Menu.icon.disabledArrowColor Color
* @uiDefault Menu.selectionForeground Color * @uiDefault Menu.selectionForeground Color
@@ -39,7 +39,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
public class FlatMenuArrowIcon public class FlatMenuArrowIcon
extends FlatAbstractIcon extends FlatAbstractIcon
{ {
protected final boolean chevron = "chevron".equals( UIManager.getString( "Component.arrowType" ) ); protected final boolean chevron = FlatUIUtils.isChevron( UIManager.getString( "Component.arrowType" ) );
protected final Color arrowColor = UIManager.getColor( "Menu.icon.arrowColor" ); protected final Color arrowColor = UIManager.getColor( "Menu.icon.arrowColor" );
protected final Color disabledArrowColor = UIManager.getColor( "Menu.icon.disabledArrowColor" ); protected final Color disabledArrowColor = UIManager.getColor( "Menu.icon.disabledArrowColor" );
protected final Color selectionForeground = UIManager.getColor( "Menu.selectionForeground" ); protected final Color selectionForeground = UIManager.getColor( "Menu.selectionForeground" );

View File

@@ -25,7 +25,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**
* "collapsed" icon for {@link javax.swing.JTree}. * "collapsed" icon for {@link javax.swing.JTree}.
* *
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault Tree.icon.collapsedColor Color * @uiDefault Tree.icon.collapsedColor Color
* *
* @author Karl Tauber * @author Karl Tauber
@@ -41,7 +41,7 @@ public class FlatTreeCollapsedIcon
FlatTreeCollapsedIcon( Color color ) { FlatTreeCollapsedIcon( Color color ) {
super( 11, 11, color ); super( 11, 11, color );
chevron = "chevron".equals( UIManager.getString( "Component.arrowType" ) ); chevron = FlatUIUtils.isChevron( UIManager.getString( "Component.arrowType" ) );
} }
@Override @Override

View File

@@ -67,7 +67,7 @@ public class FlatArrowButton
{ {
super( direction, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE ); super( direction, Color.WHITE, Color.WHITE, Color.WHITE, Color.WHITE );
this.chevron = "chevron".equals( type ); this.chevron = FlatUIUtils.isChevron( type );
this.foreground = foreground; this.foreground = foreground;
this.disabledForeground = disabledForeground; this.disabledForeground = disabledForeground;
this.hoverForeground = hoverForeground; this.hoverForeground = hoverForeground;

View File

@@ -85,7 +85,7 @@ import com.formdev.flatlaf.util.UIScale;
* @uiDefault ComboBox.editorColumns int * @uiDefault ComboBox.editorColumns int
* @uiDefault ComboBox.maximumRowCount int * @uiDefault ComboBox.maximumRowCount int
* @uiDefault ComboBox.buttonStyle String auto (default), button or none * @uiDefault ComboBox.buttonStyle String auto (default), button or none
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault Component.isIntelliJTheme boolean * @uiDefault Component.isIntelliJTheme boolean
* @uiDefault Component.borderColor Color * @uiDefault Component.borderColor Color
* @uiDefault Component.disabledBorderColor Color * @uiDefault Component.disabledBorderColor Color

View File

@@ -65,7 +65,7 @@ import com.formdev.flatlaf.util.UIScale;
* @uiDefault ScrollBar.pressedTrackColor Color optional * @uiDefault ScrollBar.pressedTrackColor Color optional
* @uiDefault ScrollBar.pressedThumbColor Color optional * @uiDefault ScrollBar.pressedThumbColor Color optional
* @uiDefault ScrollBar.pressedThumbWithTrack boolean * @uiDefault ScrollBar.pressedThumbWithTrack boolean
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault ScrollBar.showButtons boolean * @uiDefault ScrollBar.showButtons boolean
* @uiDefault ScrollBar.buttonArrowColor Color * @uiDefault ScrollBar.buttonArrowColor Color
* @uiDefault ScrollBar.buttonDisabledArrowColor Color * @uiDefault ScrollBar.buttonDisabledArrowColor Color

View File

@@ -59,7 +59,7 @@ import com.formdev.flatlaf.FlatClientProperties;
* *
* @uiDefault Component.minimumWidth int * @uiDefault Component.minimumWidth int
* @uiDefault Spinner.buttonStyle String button (default) or none * @uiDefault Spinner.buttonStyle String button (default) or none
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault Component.isIntelliJTheme boolean * @uiDefault Component.isIntelliJTheme boolean
* @uiDefault Component.borderColor Color * @uiDefault Component.borderColor Color
* @uiDefault Component.disabledBorderColor Color * @uiDefault Component.disabledBorderColor Color

View File

@@ -49,7 +49,7 @@ import com.formdev.flatlaf.util.UIScale;
* *
* <!-- FlatSplitPaneUI --> * <!-- FlatSplitPaneUI -->
* *
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault SplitPane.continuousLayout boolean * @uiDefault SplitPane.continuousLayout boolean
* @uiDefault SplitPaneDivider.oneTouchArrowColor Color * @uiDefault SplitPaneDivider.oneTouchArrowColor Color
* @uiDefault SplitPaneDivider.oneTouchHoverArrowColor Color * @uiDefault SplitPaneDivider.oneTouchHoverArrowColor Color

View File

@@ -128,6 +128,10 @@ public class FlatUIUtils
return (value instanceof Number) ? ((Number)value).floatValue() : defaultValue; return (value instanceof Number) ? ((Number)value).floatValue() : defaultValue;
} }
public static boolean isChevron( String arrowType ) {
return !"triangle".equals( arrowType );
}
public static Color nonUIResource( Color c ) { public static Color nonUIResource( Color c ) {
return (c instanceof UIResource) ? new Color( c.getRGB(), true ) : c; return (c instanceof UIResource) ? new Color( c.getRGB(), true ) : c;
} }

View File

@@ -25,11 +25,12 @@ import javax.swing.SwingConstants;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.icons.FlatAbstractIcon; import com.formdev.flatlaf.icons.FlatAbstractIcon;
import com.formdev.flatlaf.ui.FlatArrowButton; import com.formdev.flatlaf.ui.FlatArrowButton;
import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**
* "month down" icon for {@link org.jdesktop.swingx.JXMonthView}. * "month down" icon for {@link org.jdesktop.swingx.JXMonthView}.
* *
* @uiDefault Component.arrowType String triangle (default) or chevron * @uiDefault Component.arrowType String chevron (default) or triangle
* @uiDefault JXMonthView.arrowColor Color * @uiDefault JXMonthView.arrowColor Color
* @uiDefault JXMonthView.disabledArrowColor Color * @uiDefault JXMonthView.disabledArrowColor Color
* *
@@ -38,7 +39,7 @@ import com.formdev.flatlaf.ui.FlatArrowButton;
public class FlatMonthDownIcon public class FlatMonthDownIcon
extends FlatAbstractIcon extends FlatAbstractIcon
{ {
protected final boolean chevron = "chevron".equals( UIManager.getString( "Component.arrowType" ) ); protected final boolean chevron = FlatUIUtils.isChevron( UIManager.getString( "Component.arrowType" ) );
protected final Color arrowColor = UIManager.getColor( "JXMonthView.arrowColor" ); protected final Color arrowColor = UIManager.getColor( "JXMonthView.arrowColor" );
protected final Color disabledArrowColor = UIManager.getColor( "JXMonthView.disabledArrowColor" ); protected final Color disabledArrowColor = UIManager.getColor( "JXMonthView.disabledArrowColor" );