
meta {
    title: "fixme and note";
    version: "1.0.2_2020-08-17";
    description: "Displays fixme=* and note=* coloured.";
    icon: "presets/misc/fixme.svg";
    author: "Klumbumbus";
    link: "https://josm.openstreetmap.de/wiki/Styles/FixmeAndNote";
    /* min-josm-version: "????"; all except very old JOSM versions */
}

meta[lang=de] {
    title: "fixme und note";
    description: "Zeigt fixme=* und note=* farbig an.";
    link: "https://josm.openstreetmap.de/wiki/Styles/FixmeAndNote";
}

/* Create mappaint user settings. */

setting::fixme_on_nodes {
    type: boolean;
    label: tr("Display fixme on nodes");
    default: true;
}
setting::fixme_on_ways {
    type: boolean;
    label: tr("Display fixme on ways");
    default: true;
}
setting::fixme_on_areas {
    type: boolean;
    label: tr("Display fixme on areas");
    default: true;
}

setting::note_on_nodes {
    type: boolean;
    label: tr("Display note on nodes");
    default: true;
}
setting::note_on_ways {
    type: boolean;
    label: tr("Display note on ways");
    default: true;
}
setting::note_on_areas {
    type: boolean;
    label: tr("Display note on areas");
    default: true;
}


/* note */

node[note][setting("note_on_nodes")]::fixme_and_note_layer {
    text: note;
    font-size: 11;
    text-color: note_text#000000;
    text-halo-radius: 2;
    text-halo-color: note#FFFFFF;
    text-anchor-vertical: center;
    text-offset-y: 6;
    symbol-shape: circle;
    symbol-fill-color: note#FFFFFF;
    symbol-size: 10;
    symbol-stroke-color: note_text#000000;
    z-index: -1;
}

way!:closed[note][setting("note_on_ways")]::fixme_and_note_layer {
    width: 8;
    color: note#FFFFFF;
    major-z-index: -1;
}

way!:closed[note][setting("note_on_ways")] {
    text: note;
    text-color: note_text#000000;
    text-halo-radius: 2;
    text-halo-color: note#FFFFFF;
    font-size: 11;
}

area:closed[note][setting("note_on_areas")] > way::fixme_and_note_layer,
way:closed[note][setting("note_on_areas")]::fixme_and_note_layer {
    width: 8;
    color: note#FFFFFF;
     major-z-index: -1;
}

area:closed[note][setting("note_on_areas")],
way:closed[note][setting("note_on_areas")] {
    text: note;
    text-position: inside;
    text-color: note_text#000000;
    text-halo-radius: 2;
    text-halo-color: note#FFFFFF;
    font-size: 11;
}


/* fixme */

node[FIXME][setting("fixme_on_nodes")]::fixme_and_note_layer {
    text: tag("FIXME");
    font-size: 11;
    text-color: fixme_text#000000;
    text-halo-radius: 2;
    text-halo-color: fixme#FF0000;
    text-anchor-vertical: center;
    text-offset-y: 6;
    symbol-shape: circle;
    symbol-fill-color: fixme#FF0000;
    symbol-size: 10;
    symbol-stroke-color: fixme_text#000000;
    z-index: -1;
}
node[fixme][setting("fixme_on_nodes")]::fixme_and_note_layer {
    text: fixme;
    font-size: 11;
    text-color: fixme_text#000000;
    text-halo-radius: 2;
    text-halo-color: fixme#FF0000;
    text-anchor-vertical: center;
    text-offset-y: 6;
    symbol-shape: circle;
    symbol-fill-color: fixme#FF0000;
    symbol-size: 10;
    symbol-stroke-color: fixme_text#000000;
    z-index: -1;
}

way!:closed[FIXME][setting("fixme_on_ways")]::fixme_and_note_layer,
way!:closed[fixme][setting("fixme_on_ways")]::fixme_and_note_layer {
    width: 8;
    color: fixme#FF0000;
    major-z-index: -1;
}

way!:closed[FIXME][setting("fixme_on_ways")] {
    text: tag("FIXME");
    text-color: fixme_text#000000;
    text-halo-radius: 2;
    text-halo-color: fixme#FF0000;
    font-size: 11;
}
way!:closed[fixme][setting("fixme_on_ways")] {
    text: fixme;
    text-color: fixme_text#000000;
    text-halo-radius: 2;
    text-halo-color: fixme#FF0000;
    font-size: 11;
}

area:closed[FIXME][setting("fixme_on_areas")] > way::fixme_and_note_layer,
way:closed[FIXME][setting("fixme_on_areas")]::fixme_and_note_layer,
area:closed[fixme][setting("fixme_on_areas")] > way::fixme_and_note_layer,
way:closed[fixme][setting("fixme_on_areas")]::fixme_and_note_layer {
    width: 8;
    color: fixme#FF0000;
     major-z-index: -1;
}

area:closed[FIXME][setting("fixme_on_areas")],
way:closed[FIXME][setting("fixme_on_areas")] {
    text: tag("FIXME");
    text-position: inside;
    text-color: fixme_text#000000;
    text-halo-radius: 2;
    text-halo-color: fixme#FF0000;
    font-size: 11;
}
area:closed[fixme][setting("fixme_on_areas")],
way:closed[fixme][setting("fixme_on_areas")] {
    text: fixme;
    text-position: inside;
    text-color: fixme_text#000000;
    text-halo-radius: 2;
    text-halo-color: fixme#FF0000;
    font-size: 11;
}

/* fixme is more important than note, so if both are tagged the style and text of fixme is used. */

/* icon text position correction, should harmonize fine with the default JOSM internal style and its icon style setting */

node[is_prop_set(icon-image, core_note_fixme)]::fixme_and_note_layer {
    text-offset-x: 4;
}

node[note][FIXME][is_prop_set(icon-image, core_note_fixme)]::fixme_and_note_layer,
node[note][fixme][is_prop_set(icon-image, core_note_fixme)]::fixme_and_note_layer {
    text-offset-x: 10;
}

