[Qgis-developer] Default fill/outline color for svg symbols

Nyall Dawson nyall.dawson at gmail.com
Sun Oct 11 04:48:26 PDT 2015


On 11 October 2015 at 19:27, Richard Duivenvoorde <rdmailings at duif.net> wrote:
> On 11-10-15 08:04, Nyall Dawson wrote:
>
>> My latest thought is:
>> - as above, ensure that fill/outline are customisable
>> - remove the DEFAULT param values from all the shipped svgs
>> - modify symbology so that if NO default param value is specified in
>> the svg, then the existing fill color/outline color/width is preserved
>> when selecting the symbol. I think this is the best solution, as it
>> fixes the annoying color/width reseting which currently happens when
>> switching svg files but without losing the ability to set a default
>> color within a SVG.
>>
>> If no objections I'll proceed with this approach.
>
> Hi Nyall,
>
> what about fixing the first bug you were talking about, and do the rest
> in a commit after the release. In that way we can try this out a little
> more?

Actually, it needs to be fixed before release. A lot of the included
SVG images have ridiculously large border widths set, which in some
cases makes the symbol unusable (eg look under the "backgrounds" group
- the 2nd and 3rd symbols have such large border widths that the
actual symbol is obscured). This wasn't noticable before as all
borders where drawn extremely small, due to #11522.

So I need to at least update all the default border widths in these
images to a reasonable value. Given that, it's the perfect time to
also fix the default colors too.

>
> I looked at the other non svg markers, and they have actually exact the
> same behaviour as you describe above. So that is a plus.
>
> But what is that 'DEFAULT' value you are talking about? Does that mean I
> can create a custom (non shipped) symbolset which have fixed colors? OR
> have icons which do NOT change color?

Yes and yes. You could
1. make your own symbols which have the "param" modification and a
default color so that you can change these colors but they have a
preset default (no change from <2.12)
2. make your own symbols without bothering with the "param"
modification so that the symbols always have a fixed color and the
fill/outline color buttons will be disabled (no change from < 2.12 )

> What I'm talking about: I've once created a live map based on more or
> less 'standard colored' icons http://i.imgur.com/EHQOkPz.png
> What happens when I go from the red star to the blue triangle there? Do
> they stay the same color? Or CAN I make that they stay there standard
> colors, maybe by adding the 'DEFAULT' param in the svg?

If you haven't done the param modification, then the colors won't be
changed from the svg. If you HAVE done the param modification and set
a default value, then that value will still be respected. (no change
from < 2.12)

So the only change from < 2.12 will be if I go an modify all the
provided symbols to remove the default fill color, outline color and
border width. THEN for just these included symbols the fill/border
color/border width will be preserved when changing between the svgs.
Ie, exactly the same behaviour as you see with the simple marker. I'll
also make it so these symbols have a gray fill in the selector list to
keep consistency with the simple marker selector.

Nyall

>
> Sometimes it is better to 'just do it' and people can test/try with
> their own symbolsets. But as said maybe not in the feature freeze period?
>
> Regards, and again: thanks for fixing http://hub.qgis.org/issues/10908 !
>
> Richard
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list