I found a couple of problems working with upscaled image caches.
Firstly in GIMP a 'size 4 square pencil' is not 4x4, which makes editing an upscaled image very fiddly.
Secondly the wxIMAGE_QUALITY_NEAREST algorithm is not as dumb as I need it to be, and it is doing some blending when rescaling. This leads to loss of image quality in some cases.
So when we do switch to Hi-DPI support, we need to be 'all in' and only be downscaling in Audacity, not upscaling too.
Adding an orange border around the images in a theme makes it much easier to cut and paste in the correct position. I've also expanded the internal images and fixed up a few image details - the pins/bobbins on darker themes, and the light blue rather than dark blue for negative times.
The image cache that users work with should now have 'pixels' that are 4x4. This will in time allow us to have large or small versions of all buttons, and also means we have hi resolution images for HiDPI screens. The actual cost of the extra size should be small, as compression will see lots of repetition.
The main point of doing this now is so that new contributed themes can be HiDPI from the start.
For Light and Classic themes that use black text, we'll use the length/end buttons because Windows uses black for text.
For Dark and HiContrast themes that use a light colour for text, we'll use the length/end buttons IF the OS is set to use the exact same colour for text.
That for example happens if we use Microsoft's HiContrast2 and our HiContrast theme.
If the OS and theme text colour differ, then if we set blend theme colours option, which is the default, we might still use the OS colour for text in Audacity. That will happen if the OS colour has decent contrast to our theme's background colour. Decent is defined as more than 250 difference in RGB values. If we use the OS colour for text, then we get the proper length/end buttons.
Note that this adds a new feature to the theme blending, in that the text colour will often adapt. Useful when using custom text colours with HiContrast2. When the text colour adapts, we will continue to get proper length/end buttons.
Advice to users is to match OS and Audacity themes, and use the blend option. When themes don't match, it may be desirable to disable blending.
They had lost the focus/voice-over functionality because I added code to draw them in the
theme colour. Now I disable that code, IF recolouring is both set and active. This will happen
for example, if Hi-Contrast is used with the Hi-Contrast system theme.
Posterisation was caused by having a bright theme cache and using a darker theme (in linux) so the light colours 'got stretched' and showed up the relatively few distinct values there. So the Classic theme is now darker, and we expect (on Windows) that it will be recoloured to windows lighter colours.
On some Linux the default theme has dark grey drop downs, which can't be recoloured (limitation in wxWidgets) and that looks bad with the built in light themes (Classic and Light). So in these cases the theme's light colour and light buttons get recoloured.
Custom themes and dark theme don't get recoloured.
... for functions in final classes.
override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.
There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
... Should have no effect on generated code, except perhaps some slight faster
virtual function calls. Mostly useful as documentation of design intent.
Tried to mark every one of our classes that inherits from another, or is a
base for others, or has abstract virtual functions, and a few others besides.
* Loop play-at-speed and cut preview play-at-speed implemented.
* Shift or ctrl down now affect all relevant buttons, loop or cut preview, normal or at speed, and append-record.