diff --git a/radio/src/bitmaps/480x272/CMakeLists.txt b/radio/src/bitmaps/480x272/CMakeLists.txt index 55d3b6867..100143cce 100644 --- a/radio/src/bitmaps/480x272/CMakeLists.txt +++ b/radio/src/bitmaps/480x272/CMakeLists.txt @@ -40,5 +40,5 @@ add_bitmaps_target(${BITMAP_TARGET_PREFIX}_bootloader_icons ${RADIO_SRC_DIR}/bit add_dependencies(${BITMAP_TARGET_PREFIX}_bitmaps ${BITMAP_TARGET_PREFIX}_calibration_bitmaps ${BITMAP_TARGET_PREFIX}_button_bitmaps ${BITMAP_TARGET_PREFIX}_alpha_bitmaps ${BITMAP_TARGET_PREFIX}_alpha_calibration_bitmaps ${BITMAP_TARGET_PREFIX}_masks ${BITMAP_TARGET_PREFIX}_slider_masks ${BITMAP_TARGET_PREFIX}_layouts_masks - ${BITMAP_TARGET_PREFIX}_fonts ${BITMAP_TARGET_PREFIX}_themes_masks ${BITMAP_TARGET_PREFIX}_themes_alpha - ${BITMAP_TARGET_PREFIX}_volume_masks ${BITMAP_TARGET_PREFIX}_bootloader_bitmaps ${BITMAP_TARGET_PREFIX}_bootloader_icons ) + ${BITMAP_TARGET_PREFIX}_fonts ${BITMAP_TARGET_PREFIX}_themes_masks ${BITMAP_TARGET_PREFIX}_themes_alpha ${BITMAP_TARGET_PREFIX}_splash ${BITMAP_TARGET_PREFIX}_volume_masks + ${BITMAP_TARGET_PREFIX}_bootloader_bitmaps ${BITMAP_TARGET_PREFIX}_bootloader_icons ) diff --git a/radio/src/bitmaps/480x272/default_theme/mask_asterisk.png b/radio/src/bitmaps/480x272/default_theme/mask_asterisk.png new file mode 100644 index 000000000..fd10af269 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_asterisk.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_busy.png b/radio/src/bitmaps/480x272/default_theme/mask_busy.png new file mode 100644 index 000000000..a2d870205 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_busy.png differ diff --git a/radio/sdcard/horus/THEMES/EdgeTX/mask_edgetx.png b/radio/src/bitmaps/480x272/default_theme/mask_edgetx.png similarity index 100% rename from radio/sdcard/horus/THEMES/EdgeTX/mask_edgetx.png rename to radio/src/bitmaps/480x272/default_theme/mask_edgetx.png diff --git a/radio/src/bitmaps/480x272/default_theme/mask_iconback.png b/radio/src/bitmaps/480x272/default_theme/mask_iconback.png new file mode 100644 index 000000000..966f6b7f2 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_iconback.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_modelname.png b/radio/src/bitmaps/480x272/default_theme/mask_modelname.png new file mode 100644 index 000000000..2edca73ea Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_modelname.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_modelqty.png b/radio/src/bitmaps/480x272/default_theme/mask_modelqty.png new file mode 100644 index 000000000..9a38e4f13 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_modelqty.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_moveback.png b/radio/src/bitmaps/480x272/default_theme/mask_moveback.png new file mode 100644 index 000000000..63f56df92 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_moveback.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_moveico.png b/radio/src/bitmaps/480x272/default_theme/mask_moveico.png new file mode 100644 index 000000000..3662b9bb0 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_moveico.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_question.png b/radio/src/bitmaps/480x272/default_theme/mask_question.png new file mode 100644 index 000000000..66eb18762 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_question.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_sdfree.png b/radio/src/bitmaps/480x272/default_theme/mask_sdfree.png new file mode 100644 index 000000000..f0ae81982 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_sdfree.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/mask_shutdown.png b/radio/src/bitmaps/480x272/default_theme/mask_shutdown.png new file mode 100644 index 000000000..493254d77 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/mask_shutdown.png differ diff --git a/radio/src/bitmaps/480x272/default_theme/thumb.png b/radio/src/bitmaps/480x272/default_theme/thumb.png new file mode 100644 index 000000000..908575505 Binary files /dev/null and b/radio/src/bitmaps/480x272/default_theme/thumb.png differ diff --git a/radio/src/gui/colorlcd/bitmaps.cpp b/radio/src/gui/colorlcd/bitmaps.cpp index 9fa8ad456..1d8ed9670 100644 --- a/radio/src/gui/colorlcd/bitmaps.cpp +++ b/radio/src/gui/colorlcd/bitmaps.cpp @@ -195,7 +195,7 @@ const uint8_t LBM_SWIPE_RIGHT[] = { BitmapBuffer * calibStick = nullptr; BitmapBuffer * calibStickBackground = nullptr; BitmapBuffer * calibTrackpBackground = nullptr; -BitmapBuffer * modelselIconBitmap = nullptr; +//BitmapBuffer * modelselIconBitmap = nullptr; BitmapBuffer * modelselSdFreeBitmap = nullptr; BitmapBuffer * modelselModelQtyBitmap = nullptr; BitmapBuffer * modelselModelNameBitmap = nullptr; diff --git a/radio/src/gui/colorlcd/bitmaps.h b/radio/src/gui/colorlcd/bitmaps.h index 037369e91..60950a707 100644 --- a/radio/src/gui/colorlcd/bitmaps.h +++ b/radio/src/gui/colorlcd/bitmaps.h @@ -74,7 +74,7 @@ extern const uint8_t LBM_SWIPE_CIRCLE[]; extern const uint8_t LBM_SWIPE_LEFT[]; extern const uint8_t LBM_SWIPE_RIGHT[]; -extern BitmapBuffer * modelselIconBitmap; +//extern BitmapBuffer * modelselIconBitmap; extern BitmapBuffer * modelselSdFreeBitmap; extern BitmapBuffer * modelselModelQtyBitmap; extern BitmapBuffer * modelselModelNameBitmap; diff --git a/radio/src/gui/colorlcd/draw_functions.cpp b/radio/src/gui/colorlcd/draw_functions.cpp index 65f07c39b..64778e90d 100644 --- a/radio/src/gui/colorlcd/draw_functions.cpp +++ b/radio/src/gui/colorlcd/draw_functions.cpp @@ -97,18 +97,14 @@ void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration, const char if (totalDuration == 0) return; - static const BitmapBuffer* shutdown = nullptr; - if (!shutdown) { - shutdown = BitmapBuffer::loadBitmap( - OpenTxTheme::instance()->getFilePath("shutdown.bmp")); - } + static const BitmapBuffer * shutdown = OpenTxTheme::instance()->shutdown; lcd->reset(); - if (shutdown) { OpenTxTheme::instance()->drawBackground(lcd); - lcd->drawBitmap((LCD_W - shutdown->width()) / 2, - (LCD_H - shutdown->height()) / 2, shutdown); + lcd->drawMask((LCD_W - shutdown->width()) / 2, + (LCD_H - shutdown->height()) / 2, shutdown, DEFAULT_COLOR); + int quarter = duration / (totalDuration / 5); if (quarter >= 1) lcd->drawBitmapPattern(LCD_W / 2, (LCD_H - SHUTDOWN_CIRCLE_DIAMETER) / 2, diff --git a/radio/src/gui/colorlcd/fullscreen_dialog.cpp b/radio/src/gui/colorlcd/fullscreen_dialog.cpp index 73f139421..4efc67064 100644 --- a/radio/src/gui/colorlcd/fullscreen_dialog.cpp +++ b/radio/src/gui/colorlcd/fullscreen_dialog.cpp @@ -54,16 +54,14 @@ void FullScreenDialog::paint(BitmapBuffer * dc) FOCUS_COLOR, OPACITY(8)); if (type == WARNING_TYPE_ALERT || type == WARNING_TYPE_ASTERISK) { - dc->drawBitmap(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, - OpenTxTheme::instance()->asterisk); - } - else if (type == WARNING_TYPE_INFO) { - dc->drawBitmap(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, - OpenTxTheme::instance()->busy); - } - else { // confirmation - dc->drawBitmap(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, - OpenTxTheme::instance()->question); + dc->drawMask(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, + OpenTxTheme::instance()->asterisk, ALARM_COLOR); + } else if (type == WARNING_TYPE_INFO) { + dc->drawMask(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, + OpenTxTheme::instance()->busy, ALARM_COLOR); + } else { // confirmation + dc->drawMask(ALERT_BITMAP_LEFT, ALERT_BITMAP_TOP, + OpenTxTheme::instance()->question, ALARM_COLOR); } if (type == WARNING_TYPE_ALERT) { diff --git a/radio/src/gui/colorlcd/theme.cpp b/radio/src/gui/colorlcd/theme.cpp index 5954ca760..f009b3367 100644 --- a/radio/src/gui/colorlcd/theme.cpp +++ b/radio/src/gui/colorlcd/theme.cpp @@ -28,6 +28,7 @@ extern OpenTxTheme * defaultTheme; const BitmapBuffer * OpenTxTheme::asterisk = nullptr; const BitmapBuffer * OpenTxTheme::question = nullptr; const BitmapBuffer * OpenTxTheme::busy = nullptr; +const BitmapBuffer * OpenTxTheme::shutdown = nullptr; const uint8_t LBM_FOLDER[] = { #include "mask_folder.lbm" @@ -44,6 +45,22 @@ const uint8_t LBM_USB_PLUGGED[] = { #include "mask_usb_symbol.lbm" }; +const uint8_t asterisk_bitmap[] = { +#include "mask_asterisk.lbm" +}; + +const uint8_t question_bitmap[] = { +#include "mask_question.lbm" +}; + +const uint8_t busy_bitmap[] = { +#include "mask_busy.lbm" +}; + +const uint8_t shutdown_bitmap[] = { +#include "mask_shutdown.lbm" +}; + std::list & getRegisteredThemes() { static std::list themes; @@ -72,11 +89,13 @@ void OpenTxTheme::init() const void OpenTxTheme::load() const { if (!asterisk) - asterisk = BitmapBuffer::loadBitmap(getFilePath("asterisk.bmp")); + asterisk = BitmapBuffer::load8bitMask(asterisk_bitmap); if (!question) - question = BitmapBuffer::loadBitmap(getFilePath("question.bmp")); + question = BitmapBuffer::load8bitMask(question_bitmap); if (!busy) - busy = BitmapBuffer::loadBitmap(getFilePath("busy.bmp")); + busy = BitmapBuffer::load8bitMask(busy_bitmap); + if (!shutdown) + shutdown = BitmapBuffer::load8bitMask(shutdown_bitmap); } ZoneOptionValue * OpenTxTheme::getOptionValue(unsigned int index) const diff --git a/radio/src/gui/colorlcd/theme.h b/radio/src/gui/colorlcd/theme.h index 90d2db9e8..2d5c61608 100644 --- a/radio/src/gui/colorlcd/theme.h +++ b/radio/src/gui/colorlcd/theme.h @@ -114,6 +114,7 @@ class OpenTxTheme: public Theme static const BitmapBuffer * asterisk; static const BitmapBuffer * question; static const BitmapBuffer * busy; + static const BitmapBuffer * shutdown; }; OpenTxTheme * getTheme(const char * name); diff --git a/radio/src/gui/colorlcd/themes/480_bitmaps.h b/radio/src/gui/colorlcd/themes/480_bitmaps.h index 4fc6e5494..2b1df160b 100644 --- a/radio/src/gui/colorlcd/themes/480_bitmaps.h +++ b/radio/src/gui/colorlcd/themes/480_bitmaps.h @@ -226,3 +226,19 @@ const uint8_t stick_background[] = { const uint8_t trackp_background[] = { #include "alpha_trackp_background.lbm" }; +const uint8_t mask_sdfree[] = { +#include "mask_sdfree.lbm" +}; +const uint8_t mask_modelqty[] = { +#include "mask_modelqty.lbm" +}; +const uint8_t mask_modelname[] = { +#include "mask_modelname.lbm" +}; +const uint8_t mask_moveback[] = { +#include "mask_moveback.lbm" +}; +const uint8_t mask_moveico[] = { +#include "mask_moveico.lbm" +}; + diff --git a/radio/src/gui/colorlcd/themes/480_default.cpp b/radio/src/gui/colorlcd/themes/480_default.cpp index 97b6ebe79..374b474a5 100644 --- a/radio/src/gui/colorlcd/themes/480_default.cpp +++ b/radio/src/gui/colorlcd/themes/480_default.cpp @@ -213,29 +213,33 @@ class Theme480: public OpenTxTheme trackp_background, sizeof(trackp_background)); // Model Selection screen - delete modelselIconBitmap; - modelselIconBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, DEFAULT_BGCOLOR); - if (modelselIconBitmap) { - BitmapBuffer * bitmap = BitmapBuffer::loadBitmap(getFilePath("modelsel/icon_default.png")); - modelselIconBitmap->drawBitmap(20, 8, bitmap); - delete bitmap; - } + + // Unused: + // + // delete modelselIconBitmap; + // modelselIconBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, DEFAULT_BGCOLOR); + // if (modelselIconBitmap) { + // BitmapBuffer * bitmap = BitmapBuffer::loadBitmap(getFilePath("modelsel/icon_default.png")); + // modelselIconBitmap->drawBitmap(20, 8, bitmap); + // delete bitmap; + // } delete modelselSdFreeBitmap; - modelselSdFreeBitmap = BitmapBuffer::loadMask(getFilePath("modelsel/mask_sdfree.png")); + modelselSdFreeBitmap = BitmapBuffer::load8bitMask(mask_sdfree); delete modelselModelQtyBitmap; - modelselModelQtyBitmap = BitmapBuffer::loadMask(getFilePath("modelsel/mask_modelqty.png")); + modelselModelQtyBitmap = BitmapBuffer::load8bitMask(mask_modelqty); delete modelselModelNameBitmap; - modelselModelNameBitmap = BitmapBuffer::loadMask(getFilePath("modelsel/mask_modelname.png")); + modelselModelNameBitmap = BitmapBuffer::load8bitMask(mask_modelname); delete modelselModelMoveBackground; - modelselModelMoveBackground = BitmapBuffer::loadMask(getFilePath("modelsel/mask_moveback.png")); + modelselModelMoveBackground = BitmapBuffer::load8bitMask(mask_moveback); delete modelselModelMoveIcon; - modelselModelMoveIcon = BitmapBuffer::loadMask(getFilePath("modelsel/mask_moveico.png")); + modelselModelMoveIcon = BitmapBuffer::load8bitMask(mask_moveico); + //TODO: should be loaded from LUA, not here!!! delete modelselWizardBackground; modelselWizardBackground = BitmapBuffer::loadBitmap(getFilePath("wizard/background.png")); diff --git a/radio/src/gui/colorlcd/themes/flysky.cpp b/radio/src/gui/colorlcd/themes/flysky.cpp index 6cdccecb4..a395287d3 100644 --- a/radio/src/gui/colorlcd/themes/flysky.cpp +++ b/radio/src/gui/colorlcd/themes/flysky.cpp @@ -216,13 +216,13 @@ class FlyskyTheme: public OpenTxTheme calibTrackpBackground = BitmapBuffer::loadBitmap(getFilePath("trackp_background.png")); // Model Selection screen - delete modelselIconBitmap; - modelselIconBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, DEFAULT_BGCOLOR); - if (modelselIconBitmap) { - BitmapBuffer * bitmap = BitmapBuffer::loadBitmap(getFilePath("modelsel/icon_default.png")); - modelselIconBitmap->drawBitmap(20, 8, bitmap); - delete bitmap; - } + // delete modelselIconBitmap; + // modelselIconBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, DEFAULT_BGCOLOR); + // if (modelselIconBitmap) { + // BitmapBuffer * bitmap = BitmapBuffer::loadBitmap(getFilePath("modelsel/icon_default.png")); + // modelselIconBitmap->drawBitmap(20, 8, bitmap); + // delete bitmap; + // } delete modelselSdFreeBitmap; modelselSdFreeBitmap = BitmapBuffer::loadMask(getFilePath("modelsel/mask_sdfree.png"));