Ticket #7864: InactiveSelectionColor.patch

File InactiveSelectionColor.patch, 2.1 KB (added by mrwojo, 13 years ago)
  • src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java

     
    562562        }
    563563        g.drawImage(img, p.x-w/2, p.y-h/2, nc);
    564564        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);
    568575            g.drawRect(p.x-w/2-2, p.y-h/2-2, w+4, h+4);
    569576        }
    570577    }
     
    810817
    811818        Shape area = path.createTransformedShape(nc.getAffineTransform());
    812819
    813         if (!isOutlineOnly) {
     820        if (!isOutlineOnly && !inactive) {
    814821            if (fillImage == null) {
    815822                g.setColor(color);
    816823                g.fill(area);
     
    860860
    861861            if ((pb.width >= nb.getWidth() && pb.height >= nb.getHeight()) && // quick check
    862862                    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                }
    865869                Font defaultFont = g.getFont();
    866870                g.setFont (text.font);
    867871                g.drawString (name,
     
    909916        g.drawImage(smallImg, (int)(pVia.x+vx+vx2)-w/2, (int)(pVia.y+vy+vy2)-h/2, nc);
    910917
    911918        if (selected) {
    912             g.setColor(relationSelectedColor);
     919            g.setColor(inactive ? inactiveColor : relationSelectedColor);
    913920            g.drawRect((int)(pVia.x+vx+vx2)-w/2-2,(int)(pVia.y+vy+vy2)-h/2-2, w+4, h+4);
    914921        }
    915922    }