JIDE: support JideLabel to fix wrong text colors in dark themes

This commit is contained in:
Karl Tauber
2021-03-16 22:52:13 +01:00
parent ede02aaaa5
commit 3d0df51839
12 changed files with 195 additions and 10 deletions

View File

@@ -88,8 +88,8 @@ public class FlatJideOssTest
: SwingUtilities.HORIZONTAL;
frame.updateComponentsRecur( this, (c, type) -> {
if( c instanceof JideButton )
((JideButton)c).setOrientation( orientation );
if( c instanceof Alignable )
((Alignable)c).setOrientation( orientation );
} );
revalidate();
@@ -108,6 +108,8 @@ public class FlatJideOssTest
frame.updateComponentsRecur( this, (c, type) -> {
if( c instanceof JideButton )
((JideButton)c).setIcon( icon );
else if( c instanceof JideLabel )
((JideLabel)c).setIcon( icon );
} );
revalidate();
@@ -155,6 +157,12 @@ public class FlatJideOssTest
JToolBar toolBar4 = new JToolBar();
JideToggleButton jideToggleButton10 = new JideToggleButton();
JToggleButton toggleButton2 = new JToggleButton();
JLabel jideLabelLabel = new JLabel();
JideLabel jideLabel1 = new JideLabel();
JideLabel jideLabel2 = new JideLabel();
JLabel styledLabelLabel = new JLabel();
StyledLabel styledLabel1 = new StyledLabel();
StyledLabel styledLabel2 = new StyledLabel();
//======== this ========
setLayout(new MigLayout(
@@ -172,6 +180,8 @@ public class FlatJideOssTest
"[]" +
"[]" +
"[]" +
"[]para" +
"[]" +
"[]"));
//---- jidePopupLabel ----
@@ -368,6 +378,32 @@ public class FlatJideOssTest
toolBar4.add(toggleButton2);
}
add(toolBar4, "cell 1 6 3 1");
//---- jideLabelLabel ----
jideLabelLabel.setText("JideLabel:");
add(jideLabelLabel, "cell 0 7");
//---- jideLabel1 ----
jideLabel1.setText("enabled");
add(jideLabel1, "cell 1 7");
//---- jideLabel2 ----
jideLabel2.setText("disabled");
jideLabel2.setEnabled(false);
add(jideLabel2, "cell 1 7");
//---- styledLabelLabel ----
styledLabelLabel.setText("StyledLabel:");
add(styledLabelLabel, "cell 0 8");
//---- styledLabel1 ----
styledLabel1.setText("enabled");
add(styledLabel1, "cell 1 8");
//---- styledLabel2 ----
styledLabel2.setText("disabled");
styledLabel2.setEnabled(false);
add(styledLabel2, "cell 1 8");
// JFormDesigner - End of component initialization //GEN-END:initComponents
}

View File

@@ -9,7 +9,7 @@ new FormModel {
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets dialog,hidemode 3"
"$columnConstraints": "[][left][fill][fill][fill]"
"$rowConstraints": "[][][]para[][][][]"
"$rowConstraints": "[][][]para[][][][]para[][]"
} ) {
name: "this"
add( new FormComponent( "javax.swing.JLabel" ) {
@@ -277,6 +277,44 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 6 3 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "jideLabelLabel"
"text": "JideLabel:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 7"
} )
add( new FormComponent( "com.jidesoft.swing.JideLabel" ) {
name: "jideLabel1"
"text": "enabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 7"
} )
add( new FormComponent( "com.jidesoft.swing.JideLabel" ) {
name: "jideLabel2"
"text": "disabled"
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 7"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "styledLabelLabel"
"text": "StyledLabel:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 8"
} )
add( new FormComponent( "com.jidesoft.swing.StyledLabel" ) {
name: "styledLabel1"
"text": "enabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 8"
} )
add( new FormComponent( "com.jidesoft.swing.StyledLabel" ) {
name: "styledLabel2"
"text": "disabled"
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 8"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 635, 500 )