diff --git a/radio/src/gui/colorlcd/layouts/layout2x4.cpp b/radio/src/gui/colorlcd/layouts/layout2x4.cpp index b88c97095..18fa09a5e 100644 --- a/radio/src/gui/colorlcd/layouts/layout2x4.cpp +++ b/radio/src/gui/colorlcd/layouts/layout2x4.cpp @@ -56,7 +56,7 @@ class Layout2x4: public Layout getOptionValue(OPTION_PANEL1_BACKGROUND)->boolValue = true; getOptionValue(OPTION_PANEL1_COLOR)->unsignedValue = RGB(77,112,203); getOptionValue(OPTION_PANEL2_BACKGROUND)->boolValue = true; - getOptionValue(OPTION_PANEL2_COLOR)->unsignedValue = RGB(77,112,203); + getOptionValue(OPTION_PANEL2_COLOR)->unsignedValue = RGB(7,1,2); } unsigned int getZonesCount() const override @@ -79,6 +79,25 @@ class Layout2x4: public Layout return zone; } + + void paint(BitmapBuffer * dc) override; }; +void Layout2x4::paint(BitmapBuffer* dc) +{ + rect_t fullScreen = Layout::getMainZone(); + fullScreen.w /=2; + if (getOptionValue(OPTION_PANEL1_BACKGROUND)->boolValue) { + lcdSetColor(getOptionValue(OPTION_PANEL1_COLOR)->unsignedValue); + dc->drawSolidFilledRect(fullScreen.x, fullScreen.y, fullScreen.w, fullScreen.h, CUSTOM_COLOR); + } + + if (getOptionValue(OPTION_PANEL2_BACKGROUND)->boolValue) { + fullScreen.x += fullScreen.w; + lcdSetColor(getOptionValue(OPTION_PANEL2_COLOR)->unsignedValue); + dc->drawSolidFilledRect(fullScreen.x, fullScreen.y, fullScreen.w, fullScreen.h, CUSTOM_COLOR); + } + Layout::paint(dc); +} + BaseLayoutFactory layout2x4("Layout2x4", "2 x 4", LBM_LAYOUT_2x4, OPTIONS_LAYOUT_2x4); diff --git a/radio/src/gui/colorlcd/widgets/modelbmp.cpp b/radio/src/gui/colorlcd/widgets/modelbmp.cpp index daf5977f7..3eee954d0 100644 --- a/radio/src/gui/colorlcd/widgets/modelbmp.cpp +++ b/radio/src/gui/colorlcd/widgets/modelbmp.cpp @@ -97,7 +97,12 @@ class ModelBitmapWidget: public Widget TRACE("could not load bitmap '%s'", filename.c_str()); return; } - buffer->drawScaledBitmap(bitmap.get(), 0, 38, width(), height() - 38); + + if (rect.h >= 96 && rect.w >= 120) { + buffer->drawScaledBitmap(bitmap.get(), 0, 38, width(), height() - 38); + } else { + buffer->drawScaledBitmap(bitmap.get(), 0, 0, width(), height()); + } } } };