Ticket #19819: JOSM-FlatLaf-blue-links-fix.diff
| File JOSM-FlatLaf-blue-links-fix.diff, 3.8 KB (added by , 6 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/help/HelpBrowser.java
135 135 return ss; 136 136 } 137 137 ss.addRule(css); 138 139 // overwrite link color 140 String linkColor = JosmEditorPane.getLinkColor(null); 141 if (linkColor != null) { 142 ss.addRule("a {color: "+linkColor+"}"); 143 } 138 144 return ss; 139 145 } 140 146 -
src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
15 15 import javax.swing.text.html.StyleSheet; 16 16 17 17 import org.openstreetmap.josm.gui.util.GuiHelper; 18 import org.openstreetmap.josm.tools.ColorHelper; 18 19 import org.openstreetmap.josm.tools.Destroyable; 19 20 import org.openstreetmap.josm.tools.HttpClient; 20 21 import org.openstreetmap.josm.tools.LanguageInfo; … … 100 101 final Font f = UIManager.getFont("Label.font"); 101 102 final StyleSheet ss = new StyleSheet(); 102 103 ss.addRule((allBold ? "html" : "strong, b") + " {" + getFontRule(f) + '}'); 103 ss.addRule("a {text-decoration: underline; color: blue}");104 ss.addRule("a {text-decoration: underline; color: "+getLinkColor("blue")+"}"); 104 105 ss.addRule("h1 {" + getFontRule(GuiHelper.getTitleFont()) + '}'); 105 106 ss.addRule("ol {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: decimal}"); 106 107 ss.addRule("ul {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: disc}"); … … 140 141 ); 141 142 } 142 143 144 /** 145 * Returns the color (in CSS format) that should be used for links. 146 * If the current look and feel does not provide a link color, the passed default color is used. 147 * @param defaultColor the default color 148 * @return link color 149 */ 150 public static String getLinkColor(String defaultColor) { 151 Color color = UIManager.getColor("Component.linkColor"); 152 return (color != null) ? ColorHelper.color2html(color) : defaultColor; 153 } 154 143 155 @Override 144 156 public void destroy() { 145 157 TextContextualPopupMenu.disableMenuFor(this, launcher); -
src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java
56 56 "bold", 57 57 f.isItalic() ? "italic" : "normal" 58 58 ) + '}'); 59 ss.addRule("a {text-decoration: underline; color: blue}");59 ss.addRule("a {text-decoration: underline; color: "+JosmEditorPane.getLinkColor("blue")+"}"); 60 60 ss.addRule("ul {margin-left: 1cm; list-style-type: disc}"); 61 61 JosmHTMLEditorKit kit = new JosmHTMLEditorKit(); 62 62 kit.setStyleSheet(ss); -
src/org/openstreetmap/josm/gui/GettingStarted.java
56 56 private static final String STYLE = "<style type=\"text/css\">\n" 57 57 + "body {font-family: sans-serif; font-weight: bold; }\n" 58 58 + "h1 {text-align: center; }\n" 59 + "a {color: #316ed9; }\n"59 + "a {color: "+JosmEditorPane.getLinkColor("#316ed9")+"; }\n" 60 60 + ".icon {font-size: 0; }\n" 61 61 + "</style>\n"; 62 62
