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:
@@ -51,6 +51,7 @@ class FilePreview : public Window
|
|||||||
|
|
||||||
void paint(BitmapBuffer *dc) override
|
void paint(BitmapBuffer *dc) override
|
||||||
{
|
{
|
||||||
|
dc->setFormat(BMP_RGB565);
|
||||||
coord_t y = parent->getScrollPositionY() + 2;
|
coord_t y = parent->getScrollPositionY() + 2;
|
||||||
coord_t h = MENU_BODY_HEIGHT - 4;
|
coord_t h = MENU_BODY_HEIGHT - 4;
|
||||||
if (bitmap) {
|
if (bitmap) {
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class ModelBitmapWidget: public Widget
|
|||||||
|
|
||||||
void refresh(BitmapBuffer * dc) override
|
void refresh(BitmapBuffer * dc) override
|
||||||
{
|
{
|
||||||
|
dc->setFormat(BMP_ARGB4444);
|
||||||
if (buffer &&
|
if (buffer &&
|
||||||
((buffer->width() != width()) || (buffer->height() != height()) ||
|
((buffer->width() != width()) || (buffer->height() != height()) ||
|
||||||
(deps_hash != getHash()))) {
|
(deps_hash != getHash()))) {
|
||||||
@@ -88,10 +89,10 @@ class ModelBitmapWidget: public Widget
|
|||||||
std::string fullpath = std::string(BITMAPS_PATH PATH_SEPARATOR) + filename;
|
std::string fullpath = std::string(BITMAPS_PATH PATH_SEPARATOR) + filename;
|
||||||
|
|
||||||
if (!buffer || (buffer->width() != width()) || (buffer->height() != height())) {
|
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()) {
|
if (!filename.empty()) {
|
||||||
std::unique_ptr<BitmapBuffer> bitmap(BitmapBuffer::loadBitmap(fullpath.c_str()));
|
std::unique_ptr<BitmapBuffer> bitmap(BitmapBuffer::loadBitmap(fullpath.c_str()));
|
||||||
if (!bitmap) {
|
if (!bitmap) {
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 6d620a2853...25e60eac20
Reference in New Issue
Block a user