Changeset 17117 in josm for trunk/src/org
- Timestamp:
- 2020-10-08T20:26:00+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r16973 r17117 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"; -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r16149 r17117 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 } -
trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java
r14726 r17117 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(); -
trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
r14463 r17117 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; … … 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}"); … … 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() {
Note:
See TracChangeset
for help on using the changeset viewer.