mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 22:47:13 -06:00
fixed color of links in HTML text
This commit is contained in:
@@ -42,6 +42,7 @@ import javax.swing.plaf.ColorUIResource;
|
||||
import javax.swing.plaf.FontUIResource;
|
||||
import javax.swing.plaf.basic.BasicLookAndFeel;
|
||||
import javax.swing.plaf.metal.MetalLookAndFeel;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
@@ -149,6 +150,9 @@ public abstract class FlatLaf
|
||||
mnemonicListener = null;
|
||||
}
|
||||
|
||||
// restore default link color
|
||||
new HTMLEditorKit().getStyleSheet().addRule( "a { color: blue; }" );
|
||||
|
||||
if( base != null )
|
||||
base.uninitialize();
|
||||
|
||||
@@ -217,6 +221,13 @@ public abstract class FlatLaf
|
||||
if( useScreenMenuBar )
|
||||
defaults.put( "MenuBarUI", aquaMenuBarUI );
|
||||
|
||||
// update link color in HTML text
|
||||
Color linkColor = defaults.getColor( "Component.linkColor" );
|
||||
if( linkColor != null ) {
|
||||
new HTMLEditorKit().getStyleSheet().addRule(
|
||||
String.format( "a { color: #%06x; }", linkColor.getRGB() & 0xffffff ) );
|
||||
}
|
||||
|
||||
return defaults;
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ Component.borderColor=#646464
|
||||
Component.disabledBorderColor=#646464
|
||||
Component.focusedBorderColor=#466d94
|
||||
Component.focusColor=#3d6185
|
||||
Component.linkColor=#589df6
|
||||
|
||||
|
||||
#---- List ----
|
||||
|
||||
@@ -124,6 +124,7 @@ Component.borderColor=#c4c4c4
|
||||
Component.disabledBorderColor=#cfcfcf
|
||||
Component.focusedBorderColor=#87afda
|
||||
Component.focusColor=#97c3f3
|
||||
Component.linkColor=#4a78c2
|
||||
|
||||
|
||||
#---- HelpButton ----
|
||||
|
||||
Reference in New Issue
Block a user