Pointy map symbols mwp gtk4 - stronnag/mwptools GitHub Wiki

mwp Gtk4 and pointy symbols

One of the most obvious UX regressions from the otherwise excellent libshumate was the lack of "alignment" for map symbols, such that one could have a "hot spot" other than at the geometrical centre of the symbol.

There is now a merged Shumate MR (Merge Requests) to address thiss:

Prior to a 1.5 libshumate release, it is possible to use mwp with "pointy symbols", though it requires some effort. In particular, it is necessary to build libshumate from source.

Shumate build dependences

  • install gperf and gobject-introspection

Build libshumate

  • Build and install (to ~/.local/, this will save having a custom LD_LIBRARY_PATH for mwp)
    meson setup _align --prefix=$HOME/.local --libdir=$HOME/.local/lib -Dgtk_doc=false -Dsysprof=disabled
    ninja -C _align install
    

Enabling mwp to use the patched library

The only thing necessary is that mwp can load the updated libshumate.

  • If you have a local mwp install and a local libshumate install, no further action is necessary.
  • Otherwise, use the LD_LIBRARY_PATH environment variable to prioritise the updated libshumate.

Windows Caveats

Windows really doesn't really / easily have an equivalent of rpath / LD_LIBRARY_PATH / LD_PRELOAD, so it is necessary to place the modified libshumate in the mwptools/bin directory.

Example

image

image

GCS Icon

Where user defined override icons is used, it is possible to set the location of the "hot spot" in a SVG icon.

Hot spot location uses the GTK xalign and yalign parameters. There are floating point numbers in the range (0.0 - 1.0) defining a coordinate system where (0,0) is top left and (1,1) is bottom right. These values are set using special tags (mwp:xalign and mwp:yalign) in the icon's svg element:

Given the header:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     xmlns:mwp="http://www.daria.co.uk/namepaces/mwp"
     mwp:yalign="0.83"
     width="48" height="48" viewBox="0 0 48 48">

The GCS icon (co-incident with the home icon) has its hot spot at the bottom of the blue shape (same as the pointy bit of the brown home icon).

image