TabbedPane: do not clip title on left tabs when scrolled

This commit is contained in:
Karl Tauber
2020-10-15 14:53:42 +02:00
parent 1f5e08fdc6
commit 2c1075f471

View File

@@ -188,7 +188,6 @@ public class FlatTabbedPaneUI
} else
super.installDefaults();
disabledForeground = UIManager.getColor( "TabbedPane.disabledForeground" );
selectedBackground = UIManager.getColor( "TabbedPane.selectedBackground" );
selectedForeground = UIManager.getColor( "TabbedPane.selectedForeground" );
@@ -508,7 +507,8 @@ public class FlatTabbedPaneUI
viewRect.width -= 4; // subtract width of cropped edge
if( !viewRect.contains( textRect ) ) {
Rectangle r = viewRect.intersection( textRect );
title = JavaCompatibility.getClippedString( null, metrics, title, r.width );
if( r.x > viewRect.x )
title = JavaCompatibility.getClippedString( null, metrics, title, r.width );
}
}