SplitPane:

- update divider when client property `JSplitPane.expandableSide` changed
- Extras: added support for `JSplitPane.expandableSide` client property to `FlatSplitPane`
This commit is contained in:
Karl Tauber
2024-03-24 12:42:39 +01:00
parent 3b3d7d76eb
commit bd60a18ff4
3 changed files with 35 additions and 2 deletions

View File

@@ -5,11 +5,16 @@ FlatLaf Change Log
#### Fixed bugs #### Fixed bugs
- SplitPane: Update divider when client property `JSplitPane.expandableSide`
changed.
- TabbedPane: Fixed swapped back and forward scroll buttons when using - TabbedPane: Fixed swapped back and forward scroll buttons when using
`TabbedPane.scrollButtonsPlacement = trailing` (regression in FlatLaf 3.3). `TabbedPane.scrollButtonsPlacement = trailing` (regression in FlatLaf 3.3).
- Extras: `FlatSVGIcon` color filters now support linear gradients. (PR #817)
- Fixed missing window top border on Windows 10 in "full window content" mode. - Fixed missing window top border on Windows 10 in "full window content" mode.
(issue 809) (issue 809)
- Extras:
- `FlatSVGIcon` color filters now support linear gradients. (PR #817)
- Added support for `JSplitPane.expandableSide` client property to
`FlatSplitPane`.
## 3.4 ## 3.4

View File

@@ -301,6 +301,10 @@ public class FlatSplitPaneUI
// necessary to show/hide one-touch buttons on expand/collapse // necessary to show/hide one-touch buttons on expand/collapse
doLayout(); doLayout();
break; break;
case FlatClientProperties.SPLIT_PANE_EXPANDABLE_SIDE:
revalidate();
break;
} }
} }

View File

@@ -16,6 +16,7 @@
package com.formdev.flatlaf.extras.components; package com.formdev.flatlaf.extras.components;
import static com.formdev.flatlaf.FlatClientProperties.*;
import javax.swing.JSplitPane; import javax.swing.JSplitPane;
/** /**
@@ -26,6 +27,29 @@ import javax.swing.JSplitPane;
*/ */
public class FlatSplitPane public class FlatSplitPane
extends JSplitPane extends JSplitPane
implements FlatStyleableComponent implements FlatComponentExtension, FlatStyleableComponent
{ {
// NOTE: enum names must be equal to allowed strings
/** @since 3.4.1 */ public enum ExpandableSide { both, left, right }
/**
* Returns what side of the spilt pane is allowed to expand
* via one-touch expanding arrow buttons.
*
* @since 3.4.1
*/
public ExpandableSide getExpandableSide() {
return getClientPropertyEnumString( SPLIT_PANE_EXPANDABLE_SIDE, ExpandableSide.class,
null, ExpandableSide.both );
}
/**
* Specifies what side of the spilt pane is allowed to expand
* via one-touch expanding arrow buttons.
*
* @since 3.4.1
*/
public void setExpandableSide( ExpandableSide expandableSide ) {
putClientPropertyEnumString( SPLIT_PANE_EXPANDABLE_SIDE, expandableSide );
}
} }