Fix PNG transparency not working 🙂 (#878)

* Force BitmapBuffer format for widget ModelBmp and the file viewer
This patch run with the patch fix-transpareny in libopenui

* Bump libopenui

Co-authored-by: Runsys16 <rene.negre@orange.com>
This commit is contained in:
runsys
2021-10-24 10:58:30 +11:00
committed by GitHub
co-authored by Runsys16
parent 3e8faa381b
commit 2b8dfeef59
3 changed files with 5 additions and 3 deletions
+1
View File
@@ -51,6 +51,7 @@ class FilePreview : public Window
void paint(BitmapBuffer *dc) override
{
dc->setFormat(BMP_RGB565);
coord_t y = parent->getScrollPositionY() + 2;
coord_t h = MENU_BODY_HEIGHT - 4;
if (bitmap) {
+3 -2
View File
@@ -35,6 +35,7 @@ class ModelBitmapWidget: public Widget
void refresh(BitmapBuffer * dc) override
{
dc->setFormat(BMP_ARGB4444);
if (buffer &&
((buffer->width() != width()) || (buffer->height() != height()) ||
(deps_hash != getHash()))) {
@@ -88,10 +89,10 @@ class ModelBitmapWidget: public Widget
std::string fullpath = std::string(BITMAPS_PATH PATH_SEPARATOR) + filename;
if (!buffer || (buffer->width() != width()) || (buffer->height() != height())) {
buffer.reset(new BitmapBuffer(BMP_RGB565, width(), height()));
buffer.reset(new BitmapBuffer(BMP_ARGB4444, width(), height()));
}
buffer->clear(COLOR_THEME_SECONDARY3);
buffer->clear();
if (!filename.empty()) {
std::unique_ptr<BitmapBuffer> bitmap(BitmapBuffer::loadBitmap(fullpath.c_str()));
if (!bitmap) {