Ticket #19819: JOSM-statusbar-foreground-fix.diff
| File JOSM-statusbar-foreground-fix.diff, 2.2 KB (added by , 6 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/MapStatus.java
909 909 setLayout(new GridBagLayout()); 910 910 setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2)); 911 911 912 latText.setForeground(PROP_FOREGROUND_COLOR.get()); 913 lonText.setForeground(PROP_FOREGROUND_COLOR.get()); 914 headingText.setForeground(PROP_FOREGROUND_COLOR.get()); 915 distText.setForeground(PROP_FOREGROUND_COLOR.get()); 916 nameText.setForeground(PROP_FOREGROUND_COLOR.get()); 917 912 918 latText.setInheritsPopupMenu(true); 913 919 lonText.setInheritsPopupMenu(true); 914 920 headingText.setInheritsPopupMenu(true); … … 1154 1160 @Override 1155 1161 public void preferenceChanged(PreferenceChangeEvent e) { 1156 1162 String key = e.getKey(); 1157 if (key.startsWith("color.")) { 1158 key = key.substring("color.".length()); 1163 if (key.startsWith(NamedColorProperty.NAMED_COLOR_PREFIX)) { 1159 1164 if (PROP_BACKGROUND_COLOR.getKey().equals(key) || PROP_FOREGROUND_COLOR.getKey().equals(key)) { 1160 1165 for (ImageLabel il : new ImageLabel[]{latText, lonText, headingText, distText, nameText}) { 1161 1166 il.setBackground(PROP_BACKGROUND_COLOR.get()); -
src/org/openstreetmap/josm/gui/widgets/ImageLabel.java
55 55 imgLabel.setIcon(ImageProvider.get("statusline/", img, ImageSizes.STATUSLINE)); 56 56 } 57 57 58 /** 59 * Sets the foreground color of the text. 60 * @param fg text color 61 */ 58 62 @Override 63 public void setForeground(Color fg) { 64 super.setForeground(fg); 65 if (tf != null) { 66 tf.setForeground(fg); 67 } 68 } 69 70 @Override 59 71 public Dimension getPreferredSize() { 60 72 return new Dimension(25 + charCount*tf.getFontMetrics(tf.getFont()).charWidth('0'), super.getPreferredSize().height); 61 73 }
