SplitPane:

- removed `SplitPaneDivider.showHover` (hover is now enabled if hover color is specified)
- added `SplitPaneDivider.pressedColor` (for pressed/dragging in continuous layout)
- fixed painting of dragging divider in non-continuous layout (was 1px too small; added grip)
- updated styling unit tests
This commit is contained in:
Karl Tauber
2024-01-08 22:39:01 +01:00
parent d6d1d4b1b7
commit 7d16ff9e79
12 changed files with 143 additions and 63 deletions

View File

@@ -1050,9 +1050,11 @@ SplitPaneDivider.gripColor #afafaf HSL 0 0 69 javax.swing.plaf.Colo
SplitPaneDivider.gripDotCount 3
SplitPaneDivider.gripDotSize 3
SplitPaneDivider.gripGap 2
SplitPaneDivider.hoverColor #008800 HSL 120 100 27 javax.swing.plaf.ColorUIResource [UI]
SplitPaneDivider.oneTouchArrowColor #00ff00 HSL 120 100 50 javax.swing.plaf.ColorUIResource [UI]
SplitPaneDivider.oneTouchHoverArrowColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
SplitPaneDivider.oneTouchPressedArrowColor #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
SplitPaneDivider.pressedColor #000088 HSL 240 100 27 javax.swing.plaf.ColorUIResource [UI]
SplitPaneDivider.style grip

View File

@@ -76,6 +76,13 @@ public class FlatContainerTest
tabScrollChanged();
}
private void continuousLayoutChanged() {
boolean continuousLayout = continuousLayoutCheckBox.isSelected();
splitPane1.setContinuousLayout( continuousLayout );
splitPane2.setContinuousLayout( continuousLayout );
splitPane3.setContinuousLayout( continuousLayout );
}
private void showOnlyOne() {
boolean showOnlyOne = showOnlyOneCheckBox.isSelected();
@@ -519,11 +526,12 @@ public class FlatContainerTest
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
JPanel panel9 = new JPanel();
JLabel splitPaneLabel = new JLabel();
JSplitPane splitPane3 = new JSplitPane();
JSplitPane splitPane1 = new JSplitPane();
continuousLayoutCheckBox = new JCheckBox();
splitPane3 = new JSplitPane();
splitPane1 = new JSplitPane();
FlatContainerTest.Panel1 panel15 = new FlatContainerTest.Panel1();
FlatContainerTest.Panel2 panel21 = new FlatContainerTest.Panel2();
JSplitPane splitPane2 = new JSplitPane();
splitPane2 = new JSplitPane();
JPanel panel12 = new JPanel();
JLabel label3 = new JLabel();
JPanel panel13 = new JPanel();
@@ -601,6 +609,12 @@ public class FlatContainerTest
splitPaneLabel.setText("JSplitPane:");
panel9.add(splitPaneLabel, cc.xy(1, 1));
//---- continuousLayoutCheckBox ----
continuousLayoutCheckBox.setText("Continuous Layout");
continuousLayoutCheckBox.setSelected(true);
continuousLayoutCheckBox.addActionListener(e -> continuousLayoutChanged());
panel9.add(continuousLayoutCheckBox, cc.xy(3, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
//======== splitPane3 ========
{
splitPane3.setResizeWeight(0.5);
@@ -929,6 +943,10 @@ public class FlatContainerTest
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JCheckBox continuousLayoutCheckBox;
private JSplitPane splitPane3;
private JSplitPane splitPane1;
private JSplitPane splitPane2;
private JCheckBox showOnlyOneCheckBox;
private FlatTabbedPane tabbedPane1;
private FlatTabbedPane tabbedPane3;

View File

@@ -22,13 +22,32 @@ new FormModel {
name: "splitPaneLabel"
"text": "JSplitPane:"
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "continuousLayoutCheckBox"
"text": "Continuous Layout"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "continuousLayoutChanged", false ) )
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
"gridX": 3
"gridY": 1
"hAlign": sfield com.jgoodies.forms.layout.CellConstraints RIGHT
} )
add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) {
name: "splitPane3"
"resizeWeight": 0.5
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) {
name: "splitPane1"
"resizeWeight": 0.5
"oneTouchExpandable": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
add( new FormComponent( "com.formdev.flatlaf.testing.FlatContainerTest$Panel1" ) {
name: "panel15"
"background": new java.awt.Color( 217, 163, 67, 255 )
@@ -49,6 +68,9 @@ new FormModel {
"orientation": 0
"resizeWeight": 0.5
"oneTouchExpandable": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.BorderLayout ) ) {
name: "panel12"
"background": new java.awt.Color( 242, 101, 34, 255 )

View File

@@ -368,8 +368,8 @@ Spinner.focusedBackground = #ff8
#---- SplitPane ----
SplitPaneDivider.draggingColor = #800
SplitPaneDivider.showHover = false
SplitPaneDivider.hoverColor = #a00
SplitPaneDivider.hoverColor = #080
SplitPaneDivider.pressedColor = #008
SplitPaneDivider.oneTouchArrowColor = #0f0
SplitPaneDivider.oneTouchHoverArrowColor = #f00
SplitPaneDivider.oneTouchPressedArrowColor = #00f