mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 14:30:56 +03:00
TabbedPane:
- made tabs separator color lighter in dark themes so that it is easier to recognize the tabbed pane - added top and bottom tab insets to avoid that large tab icons are painted over active tab underline
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,6 +1,16 @@
|
|||||||
FlatLaf Change Log
|
FlatLaf Change Log
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
#### New features and improvements
|
||||||
|
|
||||||
|
- TabbedPane: Made tabs separator color lighter in dark themes so that it is
|
||||||
|
easier to recognize the tabbed pane.
|
||||||
|
- TabbedPane: Added top and bottom tab insets to avoid that large tab icons are
|
||||||
|
painted over active tab underline.
|
||||||
|
|
||||||
|
|
||||||
## 0.42
|
## 0.42
|
||||||
|
|
||||||
#### New features and improvements
|
#### New features and improvements
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ TabbedPane.underlineColor=#4A88C7
|
|||||||
TabbedPane.disabledUnderlineColor=#7a7a7a
|
TabbedPane.disabledUnderlineColor=#7a7a7a
|
||||||
TabbedPane.hoverColor=#2e3133
|
TabbedPane.hoverColor=#2e3133
|
||||||
TabbedPane.focusColor=#3d4b5c
|
TabbedPane.focusColor=#3d4b5c
|
||||||
TabbedPane.contentAreaColor=#323232
|
TabbedPane.contentAreaColor=#646464
|
||||||
|
|
||||||
|
|
||||||
#---- Table ----
|
#---- Table ----
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ TabbedPane.tabHeight=32
|
|||||||
TabbedPane.tabSelectionHeight=3
|
TabbedPane.tabSelectionHeight=3
|
||||||
TabbedPane.contentSeparatorHeight=1
|
TabbedPane.contentSeparatorHeight=1
|
||||||
TabbedPane.hasFullBorder=false
|
TabbedPane.hasFullBorder=false
|
||||||
TabbedPane.tabInsets=0,12,0,12
|
TabbedPane.tabInsets=4,12,4,12
|
||||||
TabbedPane.tabAreaInsets=0,0,0,0
|
TabbedPane.tabAreaInsets=0,0,0,0
|
||||||
TabbedPane.selectedTabPadInsets=0,0,0,0
|
TabbedPane.selectedTabPadInsets=0,0,0,0
|
||||||
TabbedPane.tabRunOverlay=0
|
TabbedPane.tabRunOverlay=0
|
||||||
|
|||||||
@@ -445,7 +445,7 @@ JideTabbedPane.foreground #bbbbbb javax.swing.plaf.ColorUIResource [UI]
|
|||||||
JideTabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
JideTabbedPane.tabAreaBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.tabAreaBackground #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
JideTabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI]
|
JideTabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
JideTabbedPane.tabRunOverlay 0
|
JideTabbedPane.tabRunOverlay 0
|
||||||
JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
||||||
|
|
||||||
@@ -905,7 +905,7 @@ SplitPaneUI com.formdev.flatlaf.ui.FlatSplitPaneUI
|
|||||||
#---- TabbedPane ----
|
#---- TabbedPane ----
|
||||||
|
|
||||||
TabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
TabbedPane.background #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TabbedPane.contentAreaColor #323232 javax.swing.plaf.ColorUIResource [UI]
|
TabbedPane.contentAreaColor #646464 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TabbedPane.contentOpaque true
|
TabbedPane.contentOpaque true
|
||||||
TabbedPane.contentSeparatorHeight 1
|
TabbedPane.contentSeparatorHeight 1
|
||||||
TabbedPane.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI]
|
TabbedPane.darkShadow #7e7e7e javax.swing.plaf.ColorUIResource [UI]
|
||||||
@@ -926,7 +926,7 @@ TabbedPane.selectionFollowsFocus true
|
|||||||
TabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
TabbedPane.shadow #3c3f41 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TabbedPane.tabHeight 32
|
TabbedPane.tabHeight 32
|
||||||
TabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI]
|
TabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TabbedPane.tabRunOverlay 0
|
TabbedPane.tabRunOverlay 0
|
||||||
TabbedPane.tabSelectionHeight 3
|
TabbedPane.tabSelectionHeight 3
|
||||||
TabbedPane.tabsOpaque true
|
TabbedPane.tabsOpaque true
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ JideTabbedPane.foreground #000000 javax.swing.plaf.ColorUIResource [UI]
|
|||||||
JideTabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
JideTabbedPane.tabAreaBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.tabAreaBackground #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
JideTabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI]
|
JideTabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
JideTabbedPane.tabRunOverlay 0
|
JideTabbedPane.tabRunOverlay 0
|
||||||
JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
||||||
|
|
||||||
@@ -931,7 +931,7 @@ TabbedPane.selectionFollowsFocus true
|
|||||||
TabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
TabbedPane.shadow #f2f2f2 javax.swing.plaf.ColorUIResource [UI]
|
||||||
TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TabbedPane.tabHeight 32
|
TabbedPane.tabHeight 32
|
||||||
TabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI]
|
TabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TabbedPane.tabRunOverlay 0
|
TabbedPane.tabRunOverlay 0
|
||||||
TabbedPane.tabSelectionHeight 3
|
TabbedPane.tabSelectionHeight 3
|
||||||
TabbedPane.tabsOpaque true
|
TabbedPane.tabsOpaque true
|
||||||
|
|||||||
@@ -438,7 +438,7 @@ JideTabbedPane.foreground #ff0000 javax.swing.plaf.ColorUIResource [UI]
|
|||||||
JideTabbedPane.shadow #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.shadow #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
||||||
JideTabbedPane.tabAreaBackground #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
JideTabbedPane.tabAreaBackground #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
||||||
JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
JideTabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
JideTabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI]
|
JideTabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
JideTabbedPane.tabRunOverlay 0
|
JideTabbedPane.tabRunOverlay 0
|
||||||
JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
JideTabbedPaneUI com.formdev.flatlaf.jideoss.ui.FlatJideTabbedPaneUI
|
||||||
|
|
||||||
@@ -921,7 +921,7 @@ TabbedPane.selectionFollowsFocus true
|
|||||||
TabbedPane.shadow #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
TabbedPane.shadow #ccffcc javax.swing.plaf.ColorUIResource [UI]
|
||||||
TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
TabbedPane.tabAreaInsets 0,0,0,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TabbedPane.tabHeight 32
|
TabbedPane.tabHeight 32
|
||||||
TabbedPane.tabInsets 0,12,0,12 javax.swing.plaf.InsetsUIResource [UI]
|
TabbedPane.tabInsets 4,12,4,12 javax.swing.plaf.InsetsUIResource [UI]
|
||||||
TabbedPane.tabRunOverlay 0
|
TabbedPane.tabRunOverlay 0
|
||||||
TabbedPane.tabSelectionHeight 3
|
TabbedPane.tabSelectionHeight 3
|
||||||
TabbedPane.tabSeparatorColor #0000ff javax.swing.plaf.ColorUIResource [UI]
|
TabbedPane.tabSeparatorColor #0000ff javax.swing.plaf.ColorUIResource [UI]
|
||||||
|
|||||||
@@ -131,6 +131,27 @@ public class FlatContainerTest
|
|||||||
return tab;
|
return tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void tabIconsChanged() {
|
||||||
|
boolean showTabIcons = tabIconsCheckBox.isSelected();
|
||||||
|
|
||||||
|
setTabIcons( tabbedPane1, showTabIcons );
|
||||||
|
setTabIcons( tabbedPane2, showTabIcons );
|
||||||
|
setTabIcons( tabbedPane3, showTabIcons );
|
||||||
|
setTabIcons( tabbedPane4, showTabIcons );
|
||||||
|
|
||||||
|
tabIconSizeSpinner.setEnabled( showTabIcons );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setTabIcons( JTabbedPane tabbedPane, boolean showTabIcons ) {
|
||||||
|
Object iconSize = tabIconSizeSpinner.getValue();
|
||||||
|
|
||||||
|
Icon icon = showTabIcons
|
||||||
|
? new ImageIcon( getClass().getResource( "/com/formdev/flatlaf/testing/test" + iconSize + ".png" ) )
|
||||||
|
: null;
|
||||||
|
tabbedPane.setIconAt( 0, icon );
|
||||||
|
tabbedPane.setIconAt( 1, icon );
|
||||||
|
}
|
||||||
|
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||||
JPanel panel9 = new JPanel();
|
JPanel panel9 = new JPanel();
|
||||||
@@ -154,6 +175,8 @@ public class FlatContainerTest
|
|||||||
tabScrollCheckBox = new JCheckBox();
|
tabScrollCheckBox = new JCheckBox();
|
||||||
showTabSeparatorsCheckBox = new JCheckBox();
|
showTabSeparatorsCheckBox = new JCheckBox();
|
||||||
hasFullBorderCheckBox = new JCheckBox();
|
hasFullBorderCheckBox = new JCheckBox();
|
||||||
|
tabIconsCheckBox = new JCheckBox();
|
||||||
|
tabIconSizeSpinner = new JSpinner();
|
||||||
CellConstraints cc = new CellConstraints();
|
CellConstraints cc = new CellConstraints();
|
||||||
|
|
||||||
//======== this ========
|
//======== this ========
|
||||||
@@ -262,7 +285,9 @@ public class FlatContainerTest
|
|||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
"[]",
|
"[]" +
|
||||||
|
"[fill]" +
|
||||||
|
"[fill]",
|
||||||
// rows
|
// rows
|
||||||
"[center]"));
|
"[center]"));
|
||||||
|
|
||||||
@@ -287,6 +312,17 @@ public class FlatContainerTest
|
|||||||
hasFullBorderCheckBox.setText("Show content border");
|
hasFullBorderCheckBox.setText("Show content border");
|
||||||
hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged());
|
hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged());
|
||||||
panel14.add(hasFullBorderCheckBox, "cell 3 0,alignx left,growx 0");
|
panel14.add(hasFullBorderCheckBox, "cell 3 0,alignx left,growx 0");
|
||||||
|
|
||||||
|
//---- tabIconsCheckBox ----
|
||||||
|
tabIconsCheckBox.setText("Tab icons");
|
||||||
|
tabIconsCheckBox.addActionListener(e -> tabIconsChanged());
|
||||||
|
panel14.add(tabIconsCheckBox, "cell 4 0");
|
||||||
|
|
||||||
|
//---- tabIconSizeSpinner ----
|
||||||
|
tabIconSizeSpinner.setModel(new SpinnerListModel(new String[] {"16", "24", "32", "48", "64"}));
|
||||||
|
tabIconSizeSpinner.setEnabled(false);
|
||||||
|
tabIconSizeSpinner.addChangeListener(e -> tabIconsChanged());
|
||||||
|
panel14.add(tabIconSizeSpinner, "cell 5 0");
|
||||||
}
|
}
|
||||||
panel9.add(panel14, cc.xywh(1, 11, 3, 1));
|
panel9.add(panel14, cc.xywh(1, 11, 3, 1));
|
||||||
}
|
}
|
||||||
@@ -303,6 +339,8 @@ public class FlatContainerTest
|
|||||||
private JCheckBox tabScrollCheckBox;
|
private JCheckBox tabScrollCheckBox;
|
||||||
private JCheckBox showTabSeparatorsCheckBox;
|
private JCheckBox showTabSeparatorsCheckBox;
|
||||||
private JCheckBox hasFullBorderCheckBox;
|
private JCheckBox hasFullBorderCheckBox;
|
||||||
|
private JCheckBox tabIconsCheckBox;
|
||||||
|
private JSpinner tabIconSizeSpinner;
|
||||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||||
|
|
||||||
//---- class Tab1Panel ----------------------------------------------------
|
//---- class Tab1Panel ----------------------------------------------------
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
JFDML JFormDesigner: "7.0.2.0.298" Java: "14" encoding: "UTF-8"
|
JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8"
|
||||||
|
|
||||||
new FormModel {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -131,7 +131,7 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets 0,hidemode 3"
|
"$layoutConstraints": "insets 0,hidemode 3"
|
||||||
"$columnConstraints": "[][][][]"
|
"$columnConstraints": "[][][][][fill][fill]"
|
||||||
"$rowConstraints": "[center]"
|
"$rowConstraints": "[center]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel14"
|
name: "panel14"
|
||||||
@@ -178,6 +178,35 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 0,alignx left,growx 0"
|
"value": "cell 3 0,alignx left,growx 0"
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
|
name: "tabIconsCheckBox"
|
||||||
|
"text": "Tab icons"
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabIconsChanged", false ) )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 4 0"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JSpinner" ) {
|
||||||
|
name: "tabIconSizeSpinner"
|
||||||
|
"model": new javax.swing.SpinnerListModel {
|
||||||
|
list: new java.util.ArrayList {
|
||||||
|
add( "16" )
|
||||||
|
add( "24" )
|
||||||
|
add( "32" )
|
||||||
|
add( "48" )
|
||||||
|
add( "64" )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"enabled": false
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
|
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "tabIconsChanged", false ) )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 5 0"
|
||||||
|
} )
|
||||||
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
||||||
"gridY": 11
|
"gridY": 11
|
||||||
"gridWidth": 3
|
"gridWidth": 3
|
||||||
|
|||||||
Reference in New Issue
Block a user