Commit Graph

6 Commits

Author SHA1 Message Date
Vadim Zeitlin
8f74ac7def Adjust scale of bitmaps returned by wxBitmapBundle::GetBitmap()
Bitmaps returned from this function must have the appropriate scale
factor, e.g. 2 in standard high DPI case, in order to be drawn at
correct size in the ports where logical pixels are different from the
physical ones, such as wxOSX and wxGTK3.

Notably, this allows wxGenericStaticBitmap to work correctly in high DPI
in these ports too.

This also allows to undo some of the changes done in 399b0ff9ae (Use
wxBitmapBundle instead of bitmap scale factor in wxGtkImage, 2021-10-16)
to wxGtkImage code and keep using the same code that had been used
before.
2021-10-24 23:04:45 +02:00
Vadim Zeitlin
399b0ff9ae Use wxBitmapBundle instead of bitmap scale factor in wxGtkImage
Minimal changes to the code to allow using bigger bitmaps from
wxBitmapBundle in high DPI instead of having to create individual
bitmaps with scale factor greater than 1.

Notice that this is not actually used anywhere in wxGTK yet, but will be
soon.
2021-10-16 19:58:55 +02:00
Vadim Zeitlin
77e3983091 Create disabled bitmap in BitmapProviderDefault on demand
There is no need to always do it in advance when we might never actually
need it.
2021-10-16 17:46:20 +02:00
Vadim Zeitlin
8f1be368e9 Add some comments to wxGtkImage
Document which pointers can, and can't, be null and when exactly is the
stored bitmap valid, as this is far from being immediately obvious.

No real changes.
2021-10-16 17:01:48 +02:00
Vadim Zeitlin
eb54c65e24 Separate GTK 2/3 version of BitmapProviderDefault
No real changes, just move the trivial GTK 2 stab out of the way.
2021-10-16 16:56:31 +02:00
Paul Cornett
85d63c3150 Add a class derived from GtkImage to support HiDPI bitmaps
And use it to get HiDPI support wherever we use GtkImage. This extends and
consolidates support for custom drawing of images which has already been added
somewhat redundantly in several places.
2020-09-15 11:52:03 -07:00