Hi Neil,
Is there any appetite for modifying the Platform RegisterImage and RegisterRGBAImage interfaces to add a scaling parameter? Presumably one can call SCI_RGBAIMAGESETSCALE before calling SCI_REGISTERIMAGE or SCI_REGISTERRGBAIMAGE, just like for registering marker images.
I have a proof-of-concept for Qt that draws 16x16@2x images in autocompletion lists on a HiDPI/Retina display. Currently Scintilla draws a 16x16 image as a 32x32 image on a HiDPI display, but my test draws a 32x32 image as if it was a 16x16 scaled up by 2.
On Qt, the key is to set `QPixmap.setDevicePixelRatio(2.0)`, but the QPixmap is constructed inside `ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage)`, which does not have a scale factor, and I cannot find a way to set it before or after the fact using the Scintilla message API. (There’s also the matter of dividing every call to `QPixmap.width()` and `QPixmap.height()` by `QPixmap.devicePixelRatio()`, but that’s trivial once the ratio is set.)
It might be possible to make scale=1 an optional default parameter, but I don’t know enough about C++ to know if that’ll still require downstream Platform changes or not.
Cheers,
Mitchell
P.S. I looked up how to do this for GTK and it’s pretty much not possible without using Cairo contexts instead of GdkPixbufs (
https://gitlab.gnome.org/GNOME/gtk/-/issues/613), so that’s a bummer :(