diff --git a/CHANGELOG.md b/CHANGELOG.md index 844a6d15..fda3fec2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,16 @@ FlatLaf Change Log #### Fixed bugs +- SplitPane: Update divider when client property `JSplitPane.expandableSide` + changed. - TabbedPane: Fixed swapped back and forward scroll buttons when using `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. (issue 809) +- Extras: + - `FlatSVGIcon` color filters now support linear gradients. (PR #817) + - Added support for `JSplitPane.expandableSide` client property to + `FlatSplitPane`. ## 3.4 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java index 335c11d5..862ff522 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatSplitPaneUI.java @@ -301,6 +301,10 @@ public class FlatSplitPaneUI // necessary to show/hide one-touch buttons on expand/collapse doLayout(); break; + + case FlatClientProperties.SPLIT_PANE_EXPANDABLE_SIDE: + revalidate(); + break; } } diff --git a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatSplitPane.java b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatSplitPane.java index 846ad68e..db7153c1 100644 --- a/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatSplitPane.java +++ b/flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/components/FlatSplitPane.java @@ -16,6 +16,7 @@ package com.formdev.flatlaf.extras.components; +import static com.formdev.flatlaf.FlatClientProperties.*; import javax.swing.JSplitPane; /** @@ -26,6 +27,29 @@ import javax.swing.JSplitPane; */ public class FlatSplitPane 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 ); + } }