merged PR #62 into master (with minor modifications)

Feat 59 Option to allow tabbed pane separator to take full height
This commit is contained in:
Karl Tauber
2020-02-11 16:48:00 +01:00
2 changed files with 7 additions and 1 deletions

View File

@@ -8,6 +8,9 @@ FlatLaf Change Log
bottom. (issue #34)
- ProgressBar: Fixed visual artifacts in indeterminate mode, on HiDPI screens at
125%, 150% and 175% scaling, when the progress moves around.
- TabbedPane: New option to allow tab separators to take full height (to enable
use `UIManager.put( "TabbedPane.tabSeparatorsFullHeight", true );`). (issue
#59, PR #62)
## 0.26

View File

@@ -82,6 +82,7 @@ import com.formdev.flatlaf.util.UIScale;
* @uiDefault TabbedPane.tabSelectionHeight int
* @uiDefault TabbedPane.contentSeparatorHeight int
* @uiDefault TabbedPane.showTabSeparators boolean
* @uiDefault TabbedPane.tabSeparatorsFullHeight boolean
* @uiDefault TabbedPane.hasFullBorder boolean
*
* @author Karl Tauber
@@ -103,6 +104,7 @@ public class FlatTabbedPaneUI
protected int tabSelectionHeight;
protected int contentSeparatorHeight;
protected boolean showTabSeparators;
protected boolean tabSeparatorsFullHeight;
protected boolean hasFullBorder;
protected boolean tabsOverlapBorder;
@@ -128,6 +130,7 @@ public class FlatTabbedPaneUI
tabSelectionHeight = UIManager.getInt( "TabbedPane.tabSelectionHeight" );
contentSeparatorHeight = UIManager.getInt( "TabbedPane.contentSeparatorHeight" );
showTabSeparators = UIManager.getBoolean( "TabbedPane.showTabSeparators" );
tabSeparatorsFullHeight = UIManager.getBoolean( "TabbedPane.tabSeparatorsFullHeight" );
hasFullBorder = UIManager.getBoolean( "TabbedPane.hasFullBorder" );
tabsOverlapBorder = UIManager.getBoolean( "TabbedPane.tabsOverlapBorder" );
@@ -307,7 +310,7 @@ public class FlatTabbedPaneUI
!isLastInRun( tabIndex ) )
{
float sepWidth = UIScale.scale( 1f );
float offset = UIScale.scale( 5f );
float offset = tabSeparatorsFullHeight ? 0 : UIScale.scale( 5f );
g.setColor( (tabSeparatorColor != null) ? tabSeparatorColor : contentAreaColor );
if( tabPlacement == LEFT || tabPlacement == RIGHT ) {