mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 07:17:13 -06:00
Table: optimized position of column sort arrow (issue #34)
This commit is contained in:
@@ -47,7 +47,7 @@ public class FlatAscendingSortIcon
|
|||||||
g.setColor( sortIconColor );
|
g.setColor( sortIconColor );
|
||||||
if( chevron ) {
|
if( chevron ) {
|
||||||
// chevron arrow
|
// chevron arrow
|
||||||
Path2D path = FlatUIUtils.createPath( false, 1,5, 5,1, 9,5 );
|
Path2D path = FlatUIUtils.createPath( false, 1,4, 5,0, 9,4 );
|
||||||
g.setStroke( new BasicStroke( 1f ) );
|
g.setStroke( new BasicStroke( 1f ) );
|
||||||
g.draw( path );
|
g.draw( path );
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class FlatDescendingSortIcon
|
|||||||
g.setColor( sortIconColor );
|
g.setColor( sortIconColor );
|
||||||
if( chevron ) {
|
if( chevron ) {
|
||||||
// chevron arrow
|
// chevron arrow
|
||||||
Path2D path = FlatUIUtils.createPath( false, 1,1, 5,5, 9,1 );
|
Path2D path = FlatUIUtils.createPath( false, 1,0, 5,4, 9,0 );
|
||||||
g.setStroke( new BasicStroke( 1f ) );
|
g.setStroke( new BasicStroke( 1f ) );
|
||||||
g.draw( path );
|
g.draw( path );
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -307,7 +307,9 @@ public class FlatTableHeaderUI
|
|||||||
int xi = x + ((width - sortIcon.getIconWidth()) / 2);
|
int xi = x + ((width - sortIcon.getIconWidth()) / 2);
|
||||||
int yi = (sortIconPosition == SwingConstants.TOP)
|
int yi = (sortIconPosition == SwingConstants.TOP)
|
||||||
? y + UIScale.scale( 1 )
|
? y + UIScale.scale( 1 )
|
||||||
: y + height - sortIcon.getIconHeight() - UIScale.scale( 1 );
|
: y + height - sortIcon.getIconHeight()
|
||||||
|
- 1 // for gap
|
||||||
|
- (int) (1 * UIScale.getUserScaleFactor()); // for bottom border
|
||||||
sortIcon.paintIcon( c, g, xi, yi );
|
sortIcon.paintIcon( c, g, xi, yi );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user