Fixes#2052427 [After converting to epub and running a check-up for errors on the epub editor, always the following message appears: Unexpected unknown property “panose-1” (property-no-unknown).](https://bugs.launchpad.net/calibre/+bug/2052427)
This fixes all manner of subtle issues introduced by Qt's broken
attempts to map system colors to a QPalette.
1) Highlight color being same as Windows' accent color (this is anyway
reverted in Qt 6.6)
2) Window titlebars not following system light/dark changes on Windows.
3) All the custom code that I wrote for tracking system light/dark
changes can be dropped in favor of the new QStyleHints::colorScheme
property
4) We had a fixed dark mode palette but not a fixed light mode palette.
I am sure people, especially on Linux, are going to complain about this,
but there are simply too many upsides. I will perhaps add a way to
configure the details of the light and dark palettes for people that
need it. This dialog could theoretically have a button to try to import
the standard system palette automatically to create the custom palette.
- Correct some comments so they reflect what the code is now doing.
- Make return None explicit in a few places.
- Wrap render_cover() in an if to check that cover_tuple is valid. This doesn't change behavior because the thrown exception would do the same thing, but being explicit is nice.
1) Set device pixel ratio on generated QPixmap
2) Avoid copying image data when loading cover from library
3) Convert thumbnail to RGBA in cover thread so as to do less work in
GUI thread
I can't use ReadOnlyFileBuffer because PIL requires that the buffer have the lstrip() function. I did eliminate a copy operation when writing the image to the thumbnail cache.