Changeset 17299 in josm for trunk/src/org


Ignore:
Timestamp:
2020-11-06T08:11:47+01:00 (4 years ago)
Author:
simon04
Message:

see #19819 - Obtain link color using UIManager (default to JOSM blue)

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r17117 r17299  
    5757            + "body {font-family: sans-serif; font-weight: bold; }\n"
    5858            + "h1 {text-align: center; }\n"
    59             + "a {color: " + JosmEditorPane.getLinkColor("#316ed9") + "; }\n"
     59            + "a {color: " + JosmEditorPane.getLinkColor() + "; }\n"
    6060            + ".icon {font-size: 0; }\n"
    6161            + "</style>\n";
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r17117 r17299  
    138138
    139139        // overwrite link color
    140         String linkColor = JosmEditorPane.getLinkColor(null);
     140        String linkColor = JosmEditorPane.getLinkColor();
    141141        if (linkColor != null) {
    142142            ss.addRule("a {color: " + linkColor + "}");
  • trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java

    r17117 r17299  
    5757                f.isItalic() ? "italic" : "normal"
    5858        ) + '}');
    59         ss.addRule("a {text-decoration: underline; color: " + JosmEditorPane.getLinkColor("blue") + "}");
     59        ss.addRule("a {text-decoration: underline; color: " + JosmEditorPane.getLinkColor() + "}");
    6060        ss.addRule("ul {margin-left: 1cm; list-style-type: disc}");
    6161        JosmHTMLEditorKit kit = new JosmHTMLEditorKit();
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java

    r17117 r17299  
    102102        final StyleSheet ss = new StyleSheet();
    103103        ss.addRule((allBold ? "html" : "strong, b") + " {" + getFontRule(f) + '}');
    104         ss.addRule("a {text-decoration: underline; color: " + getLinkColor("blue") + "}");
     104        ss.addRule("a {text-decoration: underline; color: " + getLinkColor() + "}");
    105105        ss.addRule("h1 {" + getFontRule(GuiHelper.getTitleFont()) + '}');
    106106        ss.addRule("ol {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: decimal}");
     
    144144    /**
    145145     * 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
     146     * If the current look and feel does not provide a link color, the JOSM blue {@code #316ed9} is returned.
    148147     * @return link color
    149148     */
    150     public static String getLinkColor(String defaultColor) {
     149    public static String getLinkColor() {
    151150        Color color = UIManager.getColor("Component.linkColor");
    152         return color != null ? ColorHelper.color2html(color) : defaultColor;
     151        return color != null ? ColorHelper.color2html(color) : "#316ed9";
    153152    }
    154153
  • trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java

    r15775 r17299  
    9393    protected final void refresh() {
    9494        if (url != null && !url.isEmpty()) {
    95             refresh("<html><a href=\""+url+"\">"+description+"</a></html>",
     95            refresh("<html><a color=\"" + JosmEditorPane.getLinkColor() + "\" href=\"" + url + "\">" + description + "</a></html>",
    9696                    Cursor.getPredefinedCursor(Cursor.HAND_CURSOR),
    9797                    String.format("<html>%s<br/>%s</html>", url, tr("Right click = copy to clipboard")));
Note: See TracChangeset for help on using the changeset viewer.