Ticket #7864: InactiveSelectionColor.patch
| File InactiveSelectionColor.patch, 2.1 KB (added by , 13 years ago) |
|---|
-
src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
562 562 } 563 563 g.drawImage(img, p.x-w/2, p.y-h/2, nc); 564 564 g.setPaintMode(); 565 if (selected || member) 566 { 567 g.setColor(selected? selectedColor : relationSelectedColor); 565 if (selected || member) { 566 Color color = null; 567 if (inactive || n.isDisabled()) { 568 color = inactiveColor; 569 } else if (selected) { 570 color = selectedColor; 571 } else { 572 color = relationSelectedColor; 573 } 574 g.setColor(color); 568 575 g.drawRect(p.x-w/2-2, p.y-h/2-2, w+4, h+4); 569 576 } 570 577 } … … 810 817 811 818 Shape area = path.createTransformedShape(nc.getAffineTransform()); 812 819 813 if (!isOutlineOnly ) {820 if (!isOutlineOnly && !inactive) { 814 821 if (fillImage == null) { 815 822 g.setColor(color); 816 823 g.fill(area); … … 860 860 861 861 if ((pb.width >= nb.getWidth() && pb.height >= nb.getHeight()) && // quick check 862 862 area.contains(centeredNBounds) // slow but nice 863 ) { 864 g.setColor(text.color); 863 ) { 864 if (inactive || osm.isDisabled()) { 865 g.setColor(inactiveColor); 866 } else { 867 g.setColor(text.color); 868 } 865 869 Font defaultFont = g.getFont(); 866 870 g.setFont (text.font); 867 871 g.drawString (name, … … 909 916 g.drawImage(smallImg, (int)(pVia.x+vx+vx2)-w/2, (int)(pVia.y+vy+vy2)-h/2, nc); 910 917 911 918 if (selected) { 912 g.setColor( relationSelectedColor);919 g.setColor(inactive ? inactiveColor : relationSelectedColor); 913 920 g.drawRect((int)(pVia.x+vx+vx2)-w/2-2,(int)(pVia.y+vy+vy2)-h/2-2, w+4, h+4); 914 921 } 915 922 }
