mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 06:50:56 +03:00
Option to allow tabbed pane separator to take full height
This commit is contained in:
@@ -133,6 +133,14 @@ public interface FlatClientProperties
|
|||||||
*/
|
*/
|
||||||
String TABBED_PANE_HAS_FULL_BORDER = "JTabbedPane.hasFullBorder";
|
String TABBED_PANE_HAS_FULL_BORDER = "JTabbedPane.hasFullBorder";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies whether tab separators (if enabled) extend to tab height.
|
||||||
|
* <p>
|
||||||
|
* <strong>Component</strong> {@link javax.swing.JTabbedPane}<br>
|
||||||
|
* <strong>Value type</strong> {@link java.lang.Boolean}
|
||||||
|
*/
|
||||||
|
String TABBED_PANE_TAB_SEPARATORS_FULL_HEIGHT = "JTabbedPane.tabSeparatorsFullHeight";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies the height of a tab.
|
* Specifies the height of a tab.
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
*
|
*
|
||||||
* @clientProperty JTabbedPane.showTabSeparators boolean
|
* @clientProperty JTabbedPane.showTabSeparators boolean
|
||||||
* @clientProperty JTabbedPane.hasFullBorder boolean
|
* @clientProperty JTabbedPane.hasFullBorder boolean
|
||||||
|
* @clientProperty JTabbedPane.tabSeparatorsFullHeight boolean
|
||||||
*
|
*
|
||||||
* <!-- BasicTabbedPaneUI -->
|
* <!-- BasicTabbedPaneUI -->
|
||||||
*
|
*
|
||||||
@@ -83,6 +84,7 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
* @uiDefault TabbedPane.contentSeparatorHeight int
|
* @uiDefault TabbedPane.contentSeparatorHeight int
|
||||||
* @uiDefault TabbedPane.showTabSeparators boolean
|
* @uiDefault TabbedPane.showTabSeparators boolean
|
||||||
* @uiDefault TabbedPane.hasFullBorder boolean
|
* @uiDefault TabbedPane.hasFullBorder boolean
|
||||||
|
* @uiDefault TabbedPane.tabSeparatorsFullHeight boolean
|
||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
@@ -105,6 +107,7 @@ public class FlatTabbedPaneUI
|
|||||||
protected boolean showTabSeparators;
|
protected boolean showTabSeparators;
|
||||||
protected boolean hasFullBorder;
|
protected boolean hasFullBorder;
|
||||||
protected boolean tabsOverlapBorder;
|
protected boolean tabsOverlapBorder;
|
||||||
|
protected boolean tabSeparatorsFullHeight;
|
||||||
|
|
||||||
public static ComponentUI createUI( JComponent c ) {
|
public static ComponentUI createUI( JComponent c ) {
|
||||||
return new FlatTabbedPaneUI();
|
return new FlatTabbedPaneUI();
|
||||||
@@ -130,6 +133,7 @@ public class FlatTabbedPaneUI
|
|||||||
showTabSeparators = UIManager.getBoolean( "TabbedPane.showTabSeparators" );
|
showTabSeparators = UIManager.getBoolean( "TabbedPane.showTabSeparators" );
|
||||||
hasFullBorder = UIManager.getBoolean( "TabbedPane.hasFullBorder" );
|
hasFullBorder = UIManager.getBoolean( "TabbedPane.hasFullBorder" );
|
||||||
tabsOverlapBorder = UIManager.getBoolean( "TabbedPane.tabsOverlapBorder" );
|
tabsOverlapBorder = UIManager.getBoolean( "TabbedPane.tabsOverlapBorder" );
|
||||||
|
tabSeparatorsFullHeight = UIManager.getBoolean( "TabbedPane.tabSeparatorsFullHeight" );
|
||||||
|
|
||||||
// scale
|
// scale
|
||||||
textIconGap = scale( textIconGap );
|
textIconGap = scale( textIconGap );
|
||||||
@@ -307,7 +311,7 @@ public class FlatTabbedPaneUI
|
|||||||
!isLastInRun( tabIndex ) )
|
!isLastInRun( tabIndex ) )
|
||||||
{
|
{
|
||||||
float sepWidth = UIScale.scale( 1f );
|
float sepWidth = UIScale.scale( 1f );
|
||||||
float offset = UIScale.scale( 5f );
|
float offset = tabSeparatorsFullHeight ? 0.0f : UIScale.scale( 5f );
|
||||||
|
|
||||||
g.setColor( (tabSeparatorColor != null) ? tabSeparatorColor : contentAreaColor );
|
g.setColor( (tabSeparatorColor != null) ? tabSeparatorColor : contentAreaColor );
|
||||||
if( tabPlacement == LEFT || tabPlacement == RIGHT ) {
|
if( tabPlacement == LEFT || tabPlacement == RIGHT ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user