fixed link color (in HTML text) in IntelliJ platform themes

This commit is contained in:
Karl Tauber
2019-12-20 18:36:25 +01:00
parent a483403774
commit e44212fc65
5 changed files with 110 additions and 2 deletions

View File

@@ -1,6 +1,11 @@
FlatLaf Change Log
==================
## Unreleased
- Fixed link color (in HTML text) in IntelliJ platform themes.
## 0.22
- TextComponent: Support placeholder text that is displayed if text field is

View File

@@ -236,12 +236,16 @@ public abstract class FlatLaf
if( useScreenMenuBar )
defaults.put( "MenuBarUI", aquaMenuBarUI );
invokePostInitialization( defaults );
return defaults;
}
void invokePostInitialization( UIDefaults defaults ) {
if( postInitialization != null ) {
postInitialization.accept( defaults );
postInitialization = null;
}
return defaults;
}
List<Class<?>> getLafClassesForDefaultsLoading() {

View File

@@ -419,6 +419,9 @@ public class IntelliJTheme
uiKeyMapping.put( "ComboBox.ArrowButton.iconColor", "ComboBox.buttonArrowColor" );
uiKeyMapping.put( "ComboBox.ArrowButton.nonEditableBackground", "ComboBox.buttonBackground" );
// Link
uiKeyMapping.put( "Link.activeForeground", "Component.linkColor" );
// ProgressBar
uiKeyMapping.put( "ProgressBar.background", "" ); // ignore
uiKeyMapping.put( "ProgressBar.foreground", "" ); // ignore
@@ -492,9 +495,14 @@ public class IntelliJTheme
public UIDefaults getDefaults() {
UIDefaults defaults = super.getDefaults();
theme.applyProperties( defaults );
super.invokePostInitialization( defaults );
return defaults;
}
@Override
void invokePostInitialization( UIDefaults defaults ) {
}
@Override
ArrayList<Class<?>> getLafClassesForDefaultsLoading() {
ArrayList<Class<?>> lafClasses = new ArrayList<>();

View File

@@ -69,7 +69,14 @@ class MoreComponentsPanel
JToggleButton toggleButton7 = new JToggleButton();
JLabel scrollBarLabel = new JLabel();
JScrollBar scrollBar1 = new JScrollBar();
JLabel label4 = new JLabel();
JScrollBar scrollBar4 = new JScrollBar();
JPanel panel3 = new JPanel();
JLabel label3 = new JLabel();
JScrollPane scrollPane15 = new JScrollPane();
JEditorPane editorPane6 = new JEditorPane();
JScrollPane scrollPane16 = new JScrollPane();
JTextPane textPane6 = new JTextPane();
JScrollBar scrollBar5 = new JScrollBar();
JScrollBar scrollBar6 = new JScrollBar();
JLabel separatorLabel = new JLabel();
@@ -211,11 +218,53 @@ class MoreComponentsPanel
scrollBar1.setOrientation(Adjustable.HORIZONTAL);
add(scrollBar1, "cell 1 1,growx");
//---- label4 ----
label4.setText("HTML:");
add(label4, "cell 5 1");
//---- scrollBar4 ----
scrollBar4.setOrientation(Adjustable.HORIZONTAL);
scrollBar4.setEnabled(false);
add(scrollBar4, "cell 1 2,growx");
//======== panel3 ========
{
panel3.setOpaque(false);
panel3.setLayout(new MigLayout(
"ltr,insets 0,hidemode 3",
// columns
"[]",
// rows
"[]" +
"[]" +
"[]"));
//---- label3 ----
label3.setText("<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a></html>");
panel3.add(label3, "cell 0 0");
//======== scrollPane15 ========
{
//---- editorPane6 ----
editorPane6.setContentType("text/html");
editorPane6.setText("JEditorPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>");
scrollPane15.setViewportView(editorPane6);
}
panel3.add(scrollPane15, "cell 0 1,grow");
//======== scrollPane16 ========
{
//---- textPane6 ----
textPane6.setContentType("text/html");
textPane6.setText("JTextPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>");
scrollPane16.setViewportView(textPane6);
}
panel3.add(scrollPane16, "cell 0 2,grow");
}
add(panel3, "cell 5 2 1 9,aligny top,growy 0");
//---- scrollBar5 ----
scrollBar5.setOrientation(Adjustable.HORIZONTAL);
scrollBar5.putClientProperty("JScrollBar.showButtons", true);

View File

@@ -140,6 +140,12 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1,growx"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label4"
"text": "HTML:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 1"
} )
add( new FormComponent( "javax.swing.JScrollBar" ) {
name: "scrollBar4"
"orientation": 0
@@ -147,6 +153,42 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2,growx"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$columnConstraints": "[]"
"$rowConstraints": "[][][]"
"$layoutConstraints": "ltr,insets 0,hidemode 3"
} ) {
name: "panel3"
"opaque": false
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label3"
"text": "<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a></html>"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane15"
add( new FormComponent( "javax.swing.JEditorPane" ) {
name: "editorPane6"
"contentType": "text/html"
"text": "JEditorPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1,grow"
} )
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane16"
add( new FormComponent( "javax.swing.JTextPane" ) {
name: "textPane6"
"contentType": "text/html"
"text": "JTextPane HTML<br>Sample <b>content</b><br> <u>text</u> with <a href=\"#\">link</a>"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2,grow"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 2 1 9,aligny top,growy 0"
} )
add( new FormComponent( "javax.swing.JScrollBar" ) {
name: "scrollBar5"
"orientation": 0