Ticket #19366: 19366.bug_fixes.patch
File 19366.bug_fixes.patch, 1.9 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
264 264 colorEdit = new JButton(tr("Choose")); 265 265 colorEdit.addActionListener(e -> { 266 266 int sel = colors.getSelectedRow(); 267 if (sel < 0) return; 267 268 sel = colors.convertRowIndexToModel(sel); 268 269 ColorEntry ce = tableModel.getEntry(sel); 269 270 JColorChooser chooser = new JColorChooser(ce.getDisplayColor()); … … 273 274 JOptionPane.OK_CANCEL_OPTION, 274 275 JOptionPane.PLAIN_MESSAGE); 275 276 if (answer == JOptionPane.OK_OPTION) { 276 colors.setValueAt(chooser.getColor(), sel, 1); 277 ce.info.setValue(chooser.getColor()); 278 tableModel.fireTableRowsUpdated(sel, sel); 277 279 } 278 280 }); 279 281 defaultSet = new JButton(tr("Reset to default")); … … 283 285 ColorEntry ce = tableModel.getEntry(sel); 284 286 Color c = ce.info.getDefaultValue(); 285 287 if (c != null) { 286 colors.setValueAt(c, sel, 1); 288 ce.info.setValue(c); 289 tableModel.fireTableRowsUpdated(sel, sel); 287 290 } 288 291 }); 289 292 JButton defaultAll = new JButton(tr("Set all to default")); … … 293 296 ColorEntry ce = data.get(i); 294 297 Color c = ce.info.getDefaultValue(); 295 298 if (c != null) { 296 colors.setValueAt(c, i, 1); 299 ce.info.setValue(c); 300 tableModel.fireTableDataChanged(); 297 301 } 298 302 } 299 303 });