leaflet: Use a measure() method

This will simplify porting to GTK+ 4.
3 jobs for measure in 2 minutes and 19 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #4428
librem5
build-debian-clang

00:02:19

passed #4427
librem5
build-debian-gcc

00:02:02

25.4%
passed #4429
librem5
build-debian-package

00:02:07