diff --git a/radio/src/gui/colorlcd/draw_functions.cpp b/radio/src/gui/colorlcd/draw_functions.cpp index 2bf5e54d8..3b507bfa0 100644 --- a/radio/src/gui/colorlcd/draw_functions.cpp +++ b/radio/src/gui/colorlcd/draw_functions.cpp @@ -205,7 +205,7 @@ void drawSleepBitmap() const BitmapBuffer * bitmap = BitmapBuffer::loadBitmap(static_cast(theme)->getFilePath("sleep.bmp")); if (bitmap) { - lcd->drawBitmap((LCD_W-bitmap->getWidth())/2, (LCD_H-bitmap->getHeight())/2, bitmap); + lcd->drawBitmap((LCD_W-bitmap->width())/2, (LCD_H-bitmap->height())/2, bitmap); delete bitmap; } @@ -224,7 +224,7 @@ void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration, const char if (shutdown) { if (duration < lastDuration) { static_cast(theme)->drawBackground(lcd); - lcd->drawBitmap((LCD_W-shutdown->getWidth())/2, (LCD_H-shutdown->getHeight())/2, shutdown); + lcd->drawBitmap((LCD_W-shutdown->width())/2, (LCD_H-shutdown->height())/2, shutdown); lcdStoreBackupBuffer(); } else { diff --git a/radio/src/gui/colorlcd/fab_button.cpp b/radio/src/gui/colorlcd/fab_button.cpp index 791b6f0fa..c060552a3 100644 --- a/radio/src/gui/colorlcd/fab_button.cpp +++ b/radio/src/gui/colorlcd/fab_button.cpp @@ -44,6 +44,6 @@ void FabButton::paint(BitmapBuffer * dc) dc->drawBitmap(0, 0, checked() ? &ALPHA_BUTTON_ON : &ALPHA_BUTTON_OFF); const BitmapBuffer * mask = theme->getIconMask(icon); if (mask) { - dc->drawMask((68 - mask->getWidth()) / 2, (68 - mask->getHeight()) / 2, mask, DEFAULT_BGCOLOR); + dc->drawMask((68 - mask->width()) / 2, (68 - mask->height()) / 2, mask, DEFAULT_BGCOLOR); } } diff --git a/radio/src/gui/colorlcd/model_select.cpp b/radio/src/gui/colorlcd/model_select.cpp index 6f5426a57..93a775efe 100644 --- a/radio/src/gui/colorlcd/model_select.cpp +++ b/radio/src/gui/colorlcd/model_select.cpp @@ -67,8 +67,8 @@ void drawModel(coord_t x, coord_t y, ModelCell * model, bool current, bool selec lcdDrawSolidRect(x, y, MODELCELL_WIDTH+2, MODELCELL_HEIGHT+2, 1, TITLE_BGCOLOR); drawShadow(x, y, MODELCELL_WIDTH+2, MODELCELL_HEIGHT+2); if (selectMode == MODE_MOVE_MODEL) { - lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->getWidth(), y, modelselModelMoveBackground, TITLE_BGCOLOR); - lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->getWidth()+12, y+5, modelselModelMoveIcon, TEXT_BGCOLOR); + lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->width(), y, modelselModelMoveBackground, TITLE_BGCOLOR); + lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->width()+12, y+5, modelselModelMoveIcon, TEXT_BGCOLOR); } } } diff --git a/radio/src/gui/colorlcd/model_select_old.cpp b/radio/src/gui/colorlcd/model_select_old.cpp index ee29fc8bf..975908c9f 100644 --- a/radio/src/gui/colorlcd/model_select_old.cpp +++ b/radio/src/gui/colorlcd/model_select_old.cpp @@ -63,8 +63,8 @@ void drawModel(coord_t x, coord_t y, ModelCell * model, bool current, bool selec lcdDrawSolidRect(x, y, MODELCELL_WIDTH+2, MODELCELL_HEIGHT+2, 1, TITLE_BGCOLOR); drawShadow(x, y, MODELCELL_WIDTH+2, MODELCELL_HEIGHT+2); if (selectMode == MODE_MOVE_MODEL) { - lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->getWidth(), y, modelselModelMoveBackground, TITLE_BGCOLOR); - lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->getWidth()+12, y+5, modelselModelMoveIcon, DEFAULT_BGCOLOR); + lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->width(), y, modelselModelMoveBackground, TITLE_BGCOLOR); + lcd->drawMask(x+MODELCELL_WIDTH+2-modelselModelMoveBackground->width()+12, y+5, modelselModelMoveIcon, DEFAULT_BGCOLOR); } } } diff --git a/radio/src/gui/colorlcd/radio_calibration.cpp b/radio/src/gui/colorlcd/radio_calibration.cpp index 6491bc143..42276f341 100644 --- a/radio/src/gui/colorlcd/radio_calibration.cpp +++ b/radio/src/gui/colorlcd/radio_calibration.cpp @@ -119,9 +119,9 @@ void RadioCalibrationPage::buildBody(FormWindow * window) if (calibRadioPict) { // Background radio image #if LCD_W > LCD_H - new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->getWidth() / 2, 5, calibRadioPict->getHeight(), calibRadioPict->getWidth()}, calibRadioPict); + new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->width() / 2, 5, calibRadioPict->height(), calibRadioPict->width()}, calibRadioPict); #else - new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->getWidth() / 2, LCD_H / 2 - calibRadioPict->getHeight() / 2, calibRadioPict->getHeight(), calibRadioPict->getWidth()}, calibRadioPict); + new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->width() / 2, LCD_H / 2 - calibRadioPict->height() / 2, calibRadioPict->height(), calibRadioPict->width()}, calibRadioPict); #endif } diff --git a/radio/src/gui/colorlcd/radio_sdmanager.cpp b/radio/src/gui/colorlcd/radio_sdmanager.cpp index 3d15d3fc1..3bc843674 100644 --- a/radio/src/gui/colorlcd/radio_sdmanager.cpp +++ b/radio/src/gui/colorlcd/radio_sdmanager.cpp @@ -74,8 +74,8 @@ class FilePreview : public Window coord_t h = MENU_BODY_HEIGHT - 4; lcd->drawSolidFilledRect(0, y, width(), h, DISABLE_COLOR); if (bitmap) { - coord_t bitmapHeight = min(h, bitmap->getHeight()); - coord_t bitmapWidth = min(width(), bitmap->getWidth()); + coord_t bitmapHeight = min(h, bitmap->height()); + coord_t bitmapWidth = min(width(), bitmap->width()); dc->drawScaledBitmap(bitmap, (width() - bitmapWidth) / 2, y + (h - bitmapHeight) / 2, bitmapWidth, bitmapHeight); } diff --git a/radio/src/gui/colorlcd/radio_spectrum_analyser.cpp b/radio/src/gui/colorlcd/radio_spectrum_analyser.cpp index 2656767e6..4427e21bc 100644 --- a/radio/src/gui/colorlcd/radio_spectrum_analyser.cpp +++ b/radio/src/gui/colorlcd/radio_spectrum_analyser.cpp @@ -50,8 +50,8 @@ class SpectrumWindow : public Window } coord_t y = max(FH, SPECTRUM_HEIGHT - peak_y - FH); - dc->drawNumber(min(100, peak_x), y, ((reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2) + peak_x * (reusableBuffer.spectrumAnalyser.span / 128)) / 1000000, TINSIZE); - dc->drawText(lcdNextPos, y, "M", TINSIZE); + dc->drawNumber(min(100, peak_x), y, ((reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2) + peak_x * (reusableBuffer.spectrumAnalyser.span / 128)) / 1000000, FONT(XXS)); + dc->drawText(lcdNextPos, y, "M", FONT(XXS)); } protected: diff --git a/radio/src/gui/colorlcd/splash.cpp b/radio/src/gui/colorlcd/splash.cpp index 569f2f8c6..0118b1ae9 100644 --- a/radio/src/gui/colorlcd/splash.cpp +++ b/radio/src/gui/colorlcd/splash.cpp @@ -45,13 +45,13 @@ void drawSplash() lcd->clear(); if (splashImg) { - lcd->drawBitmap((LCD_W - splashImg->getWidth())/2, - (LCD_H - splashImg->getHeight())/2, + lcd->drawBitmap((LCD_W - splashImg->width())/2, + (LCD_H - splashImg->height())/2, splashImg); } else { - lcd->drawBitmap((LCD_W - BMP_SPLASH.getWidth())/2, - (LCD_H - BMP_SPLASH.getHeight())/2, + lcd->drawBitmap((LCD_W - BMP_SPLASH.width())/2, + (LCD_H - BMP_SPLASH.height())/2, &BMP_SPLASH); } diff --git a/radio/src/gui/colorlcd/themes/flysky.cpp b/radio/src/gui/colorlcd/themes/flysky.cpp index 91111e83d..ca8ba4653 100644 --- a/radio/src/gui/colorlcd/themes/flysky.cpp +++ b/radio/src/gui/colorlcd/themes/flysky.cpp @@ -47,6 +47,7 @@ class FlyskyTheme: public ThemeBase lcdColorTable[TEXT_STATUSBAR_COLOR_INDEX] = WHITE; lcdColorTable[LINE_COLOR_INDEX] = GREY; lcdColorTable[CHECKBOX_COLOR_INDEX] = RGB(0, 71, 157); + lcdColorTable[SCROLLBAR_COLOR_INDEX] = RGB(0, 71, 157); lcdColorTable[MENU_BGCOLOR_INDEX] = DARKBLUE; lcdColorTable[MENU_COLOR_INDEX] = WHITE; lcdColorTable[MENU_TITLE_DISABLE_COLOR_INDEX] = RGB(GET_RED(RED)>>1, GET_GREEN(RED)>>1, GET_BLUE(RED)>>1); @@ -86,8 +87,8 @@ class FlyskyTheme: public ThemeBase delete iconMask[index]; iconMask[index] = mask; - uint8_t width = mask->getWidth(); - uint8_t height = mask->getHeight(); + uint8_t width = mask->width(); + uint8_t height = mask->height(); if (0) { delete menuIconNormal[index]; @@ -186,9 +187,9 @@ class FlyskyTheme: public ThemeBase currentMenuBackground = new BitmapBuffer(BMP_RGB565, 36, 53); } if (currentMenuBackground) { - currentMenuBackground->drawSolidFilledRect(0, 0, currentMenuBackground->getWidth(), MENU_HEADER_HEIGHT, HEADER_BGCOLOR); - currentMenuBackground->drawSolidFilledRect(0, MENU_HEADER_HEIGHT, currentMenuBackground->getWidth(), MENU_TITLE_TOP - MENU_HEADER_HEIGHT, DEFAULT_BGCOLOR); - currentMenuBackground->drawSolidFilledRect(0, MENU_TITLE_TOP, currentMenuBackground->getWidth(), currentMenuBackground->getHeight() - MENU_TITLE_TOP, TITLE_BGCOLOR); + currentMenuBackground->drawSolidFilledRect(0, 0, currentMenuBackground->width(), MENU_HEADER_HEIGHT, HEADER_BGCOLOR); + currentMenuBackground->drawSolidFilledRect(0, MENU_HEADER_HEIGHT, currentMenuBackground->width(), MENU_TITLE_TOP - MENU_HEADER_HEIGHT, DEFAULT_BGCOLOR); + currentMenuBackground->drawSolidFilledRect(0, MENU_TITLE_TOP, currentMenuBackground->width(), currentMenuBackground->height() - MENU_TITLE_TOP, TITLE_BGCOLOR); currentMenuBackground->drawMask(0, 0, background, HEADER_CURRENT_BGCOLOR); currentMenuBackground->drawMask(0, 0, shadow, TRIM_SHADOW_COLOR); currentMenuBackground->drawMask(10, 39, dot, MENU_COLOR); @@ -313,6 +314,7 @@ class FlyskyTheme: public ThemeBase lcdColorTable[DEFAULT_BGCOLOR_INDEX] = bg_color; lcdColorTable[FOCUS_BGCOLOR_INDEX] = color; lcdColorTable[CHECKBOX_COLOR_INDEX] = color; + lcdColorTable[SCROLLBAR_COLOR_INDEX] = color; lcdColorTable[CURVE_COLOR_INDEX] = color; lcdColorTable[CURVE_CURSOR_COLOR_INDEX] = color; lcdColorTable[TITLE_BGCOLOR_INDEX] = color; @@ -344,7 +346,7 @@ class FlyskyTheme: public ThemeBase { // if (topleftBitmap) { // dc->drawBitmap(0, 0, topleftBitmap); -// uint16_t width = topleftBitmap->getWidth(); +// uint16_t width = topleftBitmap->width(); // dc->drawSolidFilledRect(width, 0, LCD_W-width, MENU_HEADER_HEIGHT, HEADER_BGCOLOR); // } // else { diff --git a/radio/src/gui/colorlcd/themes/frsky.cpp b/radio/src/gui/colorlcd/themes/frsky.cpp index c9f6dc386..326775e71 100644 --- a/radio/src/gui/colorlcd/themes/frsky.cpp +++ b/radio/src/gui/colorlcd/themes/frsky.cpp @@ -46,6 +46,7 @@ class FrskyTheme: public ThemeBase lcdColorTable[TEXT_STATUSBAR_COLOR_INDEX] = WHITE; lcdColorTable[LINE_COLOR_INDEX] = GREY; lcdColorTable[CHECKBOX_COLOR_INDEX] = RED; + lcdColorTable[SCROLLBAR_COLOR_INDEX] = RED; lcdColorTable[MENU_BGCOLOR_INDEX] = DARKGREY; lcdColorTable[MENU_COLOR_INDEX] = WHITE; lcdColorTable[MENU_TITLE_DISABLE_COLOR_INDEX] = RGB(GET_RED(RED)>>1, GET_GREEN(RED)>>1, GET_BLUE(RED)>>1); @@ -79,14 +80,14 @@ class FrskyTheme: public ThemeBase iconMask[index] = mask; delete menuIconNormal[index]; - menuIconNormal[index] = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight()); + menuIconNormal[index] = new BitmapBuffer(BMP_RGB565, mask->width(), mask->height()); if (menuIconNormal[index]) { menuIconNormal[index]->clear(MENU_BGCOLOR); menuIconNormal[index]->drawMask(0, 0, mask, color); } delete menuIconSelected[index]; - menuIconSelected[index] = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight()); + menuIconSelected[index] = new BitmapBuffer(BMP_RGB565, mask->width(), mask->height()); if (menuIconSelected[index]) { menuIconSelected[index]->clear(HEADER_CURRENT_BGCOLOR); menuIconSelected[index]->drawMask(0, 0, mask, color); @@ -157,9 +158,9 @@ class FrskyTheme: public ThemeBase } if (currentMenuBackground) { - currentMenuBackground->drawSolidFilledRect(0, 0, currentMenuBackground->getWidth(), MENU_HEADER_HEIGHT, MENU_BGCOLOR); - currentMenuBackground->drawSolidFilledRect(0, MENU_HEADER_HEIGHT, currentMenuBackground->getWidth(), MENU_TITLE_TOP - MENU_HEADER_HEIGHT, DEFAULT_BGCOLOR); - currentMenuBackground->drawSolidFilledRect(0, MENU_TITLE_TOP, currentMenuBackground->getWidth(), currentMenuBackground->getHeight() - MENU_TITLE_TOP, TITLE_BGCOLOR); + currentMenuBackground->drawSolidFilledRect(0, 0, currentMenuBackground->width(), MENU_HEADER_HEIGHT, MENU_BGCOLOR); + currentMenuBackground->drawSolidFilledRect(0, MENU_HEADER_HEIGHT, currentMenuBackground->width(), MENU_TITLE_TOP - MENU_HEADER_HEIGHT, DEFAULT_BGCOLOR); + currentMenuBackground->drawSolidFilledRect(0, MENU_TITLE_TOP, currentMenuBackground->width(), currentMenuBackground->height() - MENU_TITLE_TOP, TITLE_BGCOLOR); currentMenuBackground->drawMask(0, 0, background, HEADER_CURRENT_BGCOLOR); currentMenuBackground->drawMask(0, 0, shadow, TRIM_SHADOW_COLOR); currentMenuBackground->drawMask(10, 39, dot, MENU_COLOR); @@ -292,6 +293,7 @@ class FrskyTheme: public ThemeBase lcdColorTable[DEFAULT_BGCOLOR_INDEX] = bg_color; lcdColorTable[FOCUS_BGCOLOR_INDEX] = color; lcdColorTable[CHECKBOX_COLOR_INDEX] = color; + lcdColorTable[SCROLLBAR_COLOR_INDEX] = color; lcdColorTable[CURVE_COLOR_INDEX] = color; lcdColorTable[CURVE_CURSOR_COLOR_INDEX] = color; lcdColorTable[TITLE_BGCOLOR_INDEX] = color; @@ -323,7 +325,7 @@ class FrskyTheme: public ThemeBase { if (topleftBitmap) { dc->drawBitmap(0, 0, topleftBitmap); - uint16_t width = topleftBitmap->getWidth(); + uint16_t width = topleftBitmap->width(); dc->drawSolidFilledRect(width, 0, LCD_W - width, MENU_HEADER_HEIGHT, MENU_BGCOLOR); } else { diff --git a/radio/src/lua/api_lcd.cpp b/radio/src/lua/api_lcd.cpp index 790dda798..4953b0230 100644 --- a/radio/src/lua/api_lcd.cpp +++ b/radio/src/lua/api_lcd.cpp @@ -454,8 +454,8 @@ static int luaGetBitmapSize(lua_State * L) { const BitmapBuffer * b = checkBitmap(L, 1); if (b) { - lua_pushinteger(L, b->getWidth()); - lua_pushinteger(L, b->getHeight()); + lua_pushinteger(L, b->width()); + lua_pushinteger(L, b->height()); } else { lua_pushinteger(L, 0); diff --git a/radio/src/targets/horus/libopenui_config.h b/radio/src/targets/horus/libopenui_config.h index 57696d8cb..ada10f26f 100644 --- a/radio/src/targets/horus/libopenui_config.h +++ b/radio/src/targets/horus/libopenui_config.h @@ -101,6 +101,7 @@ enum LcdColorIndex TEXT_STATUSBAR_COLOR_INDEX, LINE_COLOR_INDEX, CHECKBOX_COLOR_INDEX, + SCROLLBAR_COLOR_INDEX, MENU_BGCOLOR_INDEX, MENU_COLOR_INDEX, MENU_TITLE_DISABLE_COLOR_INDEX, diff --git a/radio/src/targets/nv14/libopenui_config.h b/radio/src/targets/nv14/libopenui_config.h index 1a08b0d5f..06af5a446 100644 --- a/radio/src/targets/nv14/libopenui_config.h +++ b/radio/src/targets/nv14/libopenui_config.h @@ -99,6 +99,7 @@ enum LcdColorIndex TEXT_STATUSBAR_COLOR_INDEX, LINE_COLOR_INDEX, CHECKBOX_COLOR_INDEX, + SCROLLBAR_COLOR_INDEX, MENU_BGCOLOR_INDEX, MENU_COLOR_INDEX, MENU_TITLE_DISABLE_COLOR_INDEX, diff --git a/radio/src/thirdparty/libopenui b/radio/src/thirdparty/libopenui index ac102065f..b6142d690 160000 --- a/radio/src/thirdparty/libopenui +++ b/radio/src/thirdparty/libopenui @@ -1 +1 @@ -Subproject commit ac102065f72f738ea91c0fa5d4b728468face373 +Subproject commit b6142d6909c97f63875c6dfb794f50de2cd1b123