Changeset 17116 in josm


Ignore:
Timestamp:
2020-10-08T20:25:58+02:00 (4 years ago)
Author:
simon04
Message:

see #19819 - MapStatus: make color preferences work (patch by DevCharly)

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

Legend:

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

    r17109 r17116  
    913913        setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2));
    914914
     915        latText.setForeground(PROP_FOREGROUND_COLOR.get());
     916        lonText.setForeground(PROP_FOREGROUND_COLOR.get());
     917        headingText.setForeground(PROP_FOREGROUND_COLOR.get());
     918        distText.setForeground(PROP_FOREGROUND_COLOR.get());
     919        nameText.setForeground(PROP_FOREGROUND_COLOR.get());
     920
    915921        latText.setInheritsPopupMenu(true);
    916922        lonText.setInheritsPopupMenu(true);
     
    11581164    public void preferenceChanged(PreferenceChangeEvent e) {
    11591165        String key = e.getKey();
    1160         if (key.startsWith("color.")) {
    1161             key = key.substring("color.".length());
     1166        if (key.startsWith(NamedColorProperty.NAMED_COLOR_PREFIX)) {
    11621167            if (PROP_BACKGROUND_COLOR.getKey().equals(key) || PROP_FOREGROUND_COLOR.getKey().equals(key)) {
    11631168                for (ImageLabel il : new ImageLabel[]{latText, lonText, headingText, distText, nameText}) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/ImageLabel.java

    r13369 r17116  
    5656    }
    5757
     58    /**
     59     * Sets the foreground color of the text.
     60     * @param fg text color
     61     */
     62    @Override
     63    public void setForeground(Color fg) {
     64        super.setForeground(fg);
     65        if (tf != null) {
     66            tf.setForeground(fg);
     67        }
     68    }
     69
    5870    @Override
    5971    public Dimension getPreferredSize() {
Note: See TracChangeset for help on using the changeset viewer.