Merge pull request #15 from EdgeTX/embedded-default-theme
Embedded default theme
This commit is contained in:
@@ -195,8 +195,7 @@ const uint8_t LBM_SWIPE_RIGHT[] = {
|
||||
BitmapBuffer * calibStick = nullptr;
|
||||
BitmapBuffer * calibStickBackground = nullptr;
|
||||
BitmapBuffer * calibTrackpBackground = nullptr;
|
||||
BitmapBuffer * calibRadioPict = nullptr;
|
||||
BitmapBuffer * modelselIconBitmap = nullptr;
|
||||
//BitmapBuffer * modelselIconBitmap = nullptr;
|
||||
BitmapBuffer * modelselSdFreeBitmap = nullptr;
|
||||
BitmapBuffer * modelselModelQtyBitmap = nullptr;
|
||||
BitmapBuffer * modelselModelNameBitmap = nullptr;
|
||||
|
||||
@@ -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;
|
||||
@@ -86,7 +86,6 @@ extern BitmapBuffer * modelselWizardBackground;
|
||||
extern BitmapBuffer * calibStick;
|
||||
extern BitmapBuffer * calibStickBackground;
|
||||
extern BitmapBuffer * calibTrackpBackground;
|
||||
extern BitmapBuffer * calibRadioPict;
|
||||
|
||||
// Channels monitor bitmaps
|
||||
extern BitmapBuffer * chanMonLockedBitmap;
|
||||
|
||||
@@ -74,68 +74,68 @@ void drawValueOrGVar(BitmapBuffer * dc, coord_t x, coord_t y, gvar_t value, gvar
|
||||
}
|
||||
}
|
||||
|
||||
constexpr LcdFlags splash_background_color =
|
||||
COLOR2FLAGS(((0xC >> 3) << 11) | ((0x3F >> 2) << 5) | (0x66 >> 3));
|
||||
|
||||
void drawSleepBitmap()
|
||||
{
|
||||
lcd->reset();
|
||||
lcd->clear();
|
||||
|
||||
const BitmapBuffer * bitmap = BitmapBuffer::loadBitmap(OpenTxTheme::instance()->getFilePath("sleep.bmp"));
|
||||
const BitmapBuffer* bitmap = OpenTxTheme::instance()->shutdown;
|
||||
if (bitmap) {
|
||||
lcd->drawBitmap((LCD_W-bitmap->width())/2, (LCD_H-bitmap->height())/2, bitmap);
|
||||
delete bitmap;
|
||||
lcd->drawMask((LCD_W-bitmap->width())/2, (LCD_H-bitmap->height())/2,
|
||||
bitmap, splash_background_color);
|
||||
}
|
||||
|
||||
lcdRefresh();
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: move shutdown animation to Theme
|
||||
//
|
||||
#define SHUTDOWN_CIRCLE_DIAMETER 150
|
||||
void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration, const char * message)
|
||||
|
||||
void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration,
|
||||
const char* message)
|
||||
{
|
||||
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();
|
||||
|
||||
lcd->clear(splash_background_color);
|
||||
|
||||
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,
|
||||
COLOR2FLAGS(WHITE));
|
||||
|
||||
int quarter = duration / (totalDuration / 5);
|
||||
if (quarter >= 1)
|
||||
lcd->drawBitmapPattern(LCD_W / 2, (LCD_H - SHUTDOWN_CIRCLE_DIAMETER) / 2,
|
||||
LBM_SHUTDOWN_CIRCLE, DEFAULT_COLOR, 0,
|
||||
LBM_SHUTDOWN_CIRCLE, COLOR2FLAGS(WHITE), 0,
|
||||
SHUTDOWN_CIRCLE_DIAMETER / 2);
|
||||
if (quarter >= 2)
|
||||
lcd->drawBitmapPattern(LCD_W / 2, LCD_H / 2, LBM_SHUTDOWN_CIRCLE,
|
||||
DEFAULT_COLOR, SHUTDOWN_CIRCLE_DIAMETER / 2,
|
||||
COLOR2FLAGS(WHITE), SHUTDOWN_CIRCLE_DIAMETER / 2,
|
||||
SHUTDOWN_CIRCLE_DIAMETER / 2);
|
||||
if (quarter >= 3)
|
||||
lcd->drawBitmapPattern((LCD_W - SHUTDOWN_CIRCLE_DIAMETER) / 2, LCD_H / 2,
|
||||
LBM_SHUTDOWN_CIRCLE, DEFAULT_COLOR,
|
||||
LBM_SHUTDOWN_CIRCLE, COLOR2FLAGS(WHITE),
|
||||
SHUTDOWN_CIRCLE_DIAMETER,
|
||||
SHUTDOWN_CIRCLE_DIAMETER / 2);
|
||||
if (quarter >= 4)
|
||||
lcd->drawBitmapPattern((LCD_W - SHUTDOWN_CIRCLE_DIAMETER) / 2,
|
||||
(LCD_H - SHUTDOWN_CIRCLE_DIAMETER) / 2,
|
||||
LBM_SHUTDOWN_CIRCLE, DEFAULT_COLOR,
|
||||
LBM_SHUTDOWN_CIRCLE, COLOR2FLAGS(WHITE),
|
||||
SHUTDOWN_CIRCLE_DIAMETER * 3 / 2,
|
||||
SHUTDOWN_CIRCLE_DIAMETER / 2);
|
||||
} else {
|
||||
lcd->clear();
|
||||
//lcd->clear();
|
||||
int quarter = duration / (totalDuration / 5);
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
if (quarter >= i) {
|
||||
lcd->drawSolidFilledRect(LCD_W / 2 - 70 + 24 * i, LCD_H / 2 - 10, 20,
|
||||
20, DEFAULT_BGCOLOR);
|
||||
20, COLOR2FLAGS(WHITE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()->error, 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()->error, ALARM_COLOR);
|
||||
}
|
||||
|
||||
if (type == WARNING_TYPE_ALERT) {
|
||||
|
||||
@@ -69,16 +69,9 @@ void RadioCalibrationPage::buildBody(FormWindow * window)
|
||||
{
|
||||
menuCalibrationState = CALIB_START;
|
||||
|
||||
if (calibRadioPict) {
|
||||
// Background radio image
|
||||
#if LCD_W > LCD_H
|
||||
new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->width() / 2, 5, calibRadioPict->height(), calibRadioPict->width()}, calibRadioPict);
|
||||
#else
|
||||
new StaticBitmap(window, {LCD_W / 2 - calibRadioPict->width() / 2, LCD_H / 2 - calibRadioPict->height() / 2, calibRadioPict->height(), calibRadioPict->width()}, calibRadioPict);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The two sticks
|
||||
|
||||
//TODO: dynamic placing
|
||||
new StickCalibrationWindow(window, {40, 20, 90, 90}, STICK1, STICK2);
|
||||
new StickCalibrationWindow(window, {LCD_W - 130, 20, 90, 90}, STICK4, STICK3);
|
||||
|
||||
|
||||
@@ -22,35 +22,38 @@
|
||||
|
||||
#if defined(SPLASH)
|
||||
|
||||
const uint8_t __bmp_splash[] __ALIGNED(4) {
|
||||
#include "bmp_splash.lbm"
|
||||
const uint8_t __bmp_splash[] {
|
||||
#include "big_logo.lbm"
|
||||
};
|
||||
Bitmap BMP_SPLASH(BMP_RGB565, (const uint16_t *)__bmp_splash);
|
||||
|
||||
void drawSplash()
|
||||
{
|
||||
static bool loadImgFromSD = true;
|
||||
constexpr LcdFlags splash_background_color =
|
||||
COLOR2FLAGS(((0xC >> 3) << 11) | ((0x3F >> 2) << 5) | (0x66 >> 3));
|
||||
|
||||
static bool loadSplashImg = true;
|
||||
static BitmapBuffer * splashImg = nullptr;
|
||||
|
||||
if (loadImgFromSD && splashImg == nullptr) {
|
||||
// try splash from SD card first
|
||||
if (loadSplashImg && splashImg == nullptr) {
|
||||
if (!sdMounted()) sdInit();
|
||||
splashImg = BitmapBuffer::loadBitmap(BITMAPS_PATH "/" SPLASH_FILE);
|
||||
loadImgFromSD = false;
|
||||
loadSplashImg = false;
|
||||
|
||||
// otherwise load from FLASH
|
||||
if (splashImg == nullptr) {
|
||||
splashImg = BitmapBuffer::loadRamBitmap(__bmp_splash, sizeof(__bmp_splash));
|
||||
}
|
||||
}
|
||||
|
||||
lcd->clear();
|
||||
lcd->clear(splash_background_color);
|
||||
|
||||
if (splashImg) {
|
||||
lcd->drawBitmap((LCD_W - splashImg->width())/2,
|
||||
(LCD_H - splashImg->height())/2,
|
||||
splashImg);
|
||||
}
|
||||
else {
|
||||
lcd->drawBitmap((LCD_W - BMP_SPLASH.width())/2,
|
||||
(LCD_H - BMP_SPLASH.height())/2,
|
||||
&BMP_SPLASH);
|
||||
}
|
||||
|
||||
|
||||
lcdRefresh();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
//#include "modal_window.h"
|
||||
|
||||
extern OpenTxTheme * defaultTheme;
|
||||
const BitmapBuffer * OpenTxTheme::asterisk = nullptr;
|
||||
const BitmapBuffer * OpenTxTheme::question = nullptr;
|
||||
const BitmapBuffer * OpenTxTheme::error = nullptr;
|
||||
const BitmapBuffer * OpenTxTheme::busy = nullptr;
|
||||
const BitmapBuffer * OpenTxTheme::shutdown = nullptr;
|
||||
|
||||
const uint8_t LBM_FOLDER[] = {
|
||||
#include "mask_folder.lbm"
|
||||
@@ -44,6 +44,19 @@ const uint8_t LBM_USB_PLUGGED[] = {
|
||||
#include "mask_usb_symbol.lbm"
|
||||
};
|
||||
|
||||
|
||||
const uint8_t error_bitmap[] = {
|
||||
#include "mask_error.lbm"
|
||||
};
|
||||
|
||||
const uint8_t busy_bitmap[] = {
|
||||
#include "mask_busy.lbm"
|
||||
};
|
||||
|
||||
const uint8_t shutdown_bitmap[] = {
|
||||
#include "mask_shutdown.lbm"
|
||||
};
|
||||
|
||||
std::list<OpenTxTheme *> & getRegisteredThemes()
|
||||
{
|
||||
static std::list<OpenTxTheme *> themes;
|
||||
@@ -71,12 +84,12 @@ void OpenTxTheme::init() const
|
||||
|
||||
void OpenTxTheme::load() const
|
||||
{
|
||||
if (!asterisk)
|
||||
asterisk = BitmapBuffer::loadBitmap(getFilePath("asterisk.bmp"));
|
||||
if (!question)
|
||||
question = BitmapBuffer::loadBitmap(getFilePath("question.bmp"));
|
||||
if (!error)
|
||||
error = BitmapBuffer::load8bitMask(error_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
|
||||
|
||||
@@ -111,9 +111,9 @@ class OpenTxTheme: public Theme
|
||||
BitmapBuffer * thumb;
|
||||
|
||||
public:
|
||||
static const BitmapBuffer * asterisk;
|
||||
static const BitmapBuffer * question;
|
||||
static const BitmapBuffer * error;
|
||||
static const BitmapBuffer * busy;
|
||||
static const BitmapBuffer * shutdown;
|
||||
};
|
||||
|
||||
OpenTxTheme * getTheme(const char * name);
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
const uint8_t mask_next[] = {
|
||||
#include "mask_next.lbm"
|
||||
};
|
||||
const uint8_t mask_back[] = {
|
||||
#include "mask_back.lbm"
|
||||
};
|
||||
const uint8_t mask_currentmenu_bg[] = {
|
||||
#include "mask_currentmenu_bg.lbm"
|
||||
};
|
||||
const uint8_t mask_currentmenu_dot[] = {
|
||||
#include "mask_currentmenu_dot.lbm"
|
||||
};
|
||||
const uint8_t mask_currentmenu_shadow[] = {
|
||||
#include "mask_currentmenu_shadow.lbm"
|
||||
};
|
||||
const uint8_t mask_menu_model[] = {
|
||||
#include "mask_menu_model.lbm"
|
||||
};
|
||||
const uint8_t mask_menu_radio[] = {
|
||||
#include "mask_menu_radio.lbm"
|
||||
};
|
||||
const uint8_t mask_menu_stats[] = {
|
||||
#include "mask_menu_stats.lbm"
|
||||
};
|
||||
const uint8_t mask_menu_theme[] = {
|
||||
#include "mask_menu_theme.lbm"
|
||||
};
|
||||
const uint8_t mask_model_curves[] = {
|
||||
#include "mask_model_curves.lbm"
|
||||
};
|
||||
const uint8_t mask_model_flight_modes[] = {
|
||||
#include "mask_model_flight_modes.lbm"
|
||||
};
|
||||
const uint8_t mask_model_gvars[] = {
|
||||
#include "mask_model_gvars.lbm"
|
||||
};
|
||||
const uint8_t mask_model_heli[] = {
|
||||
#include "mask_model_heli.lbm"
|
||||
};
|
||||
const uint8_t mask_model_inputs[] = {
|
||||
#include "mask_model_inputs.lbm"
|
||||
};
|
||||
const uint8_t mask_model_logical_switches[] = {
|
||||
#include "mask_model_logical_switches.lbm"
|
||||
};
|
||||
const uint8_t mask_model_lua_scripts[] = {
|
||||
#include "mask_model_lua_scripts.lbm"
|
||||
};
|
||||
const uint8_t mask_model_mixer[] = {
|
||||
#include "mask_model_mixer.lbm"
|
||||
};
|
||||
const uint8_t mask_model_outputs[] = {
|
||||
#include "mask_model_outputs.lbm"
|
||||
};
|
||||
const uint8_t mask_model_setup[] = {
|
||||
#include "mask_model_setup.lbm"
|
||||
};
|
||||
const uint8_t mask_model_special_functions[] = {
|
||||
#include "mask_model_special_functions.lbm"
|
||||
};
|
||||
const uint8_t mask_model_telemetry[] = {
|
||||
#include "mask_model_telemetry.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor[] = {
|
||||
#include "mask_monitor.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_channels1[] = {
|
||||
#include "mask_monitor_channels1.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_channels2[] = {
|
||||
#include "mask_monitor_channels2.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_channels3[] = {
|
||||
#include "mask_monitor_channels3.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_channels4[] = {
|
||||
#include "mask_monitor_channels4.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_gvars[] = {
|
||||
#include "mask_monitor_gvars.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_inver[] = {
|
||||
#include "mask_monitor_inver.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_lockch[] = {
|
||||
#include "mask_monitor_lockch.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_logsw[] = {
|
||||
#include "mask_monitor_logsw.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_mixes1[] = {
|
||||
#include "mask_monitor_mixes1.lbm"
|
||||
};
|
||||
const uint8_t mask_monitor_mixes2[] = {
|
||||
#include "mask_monitor_mixes2.lbm"
|
||||
};
|
||||
const uint8_t mask_mplex_add[] = {
|
||||
#include "mask_mplex_add.lbm"
|
||||
};
|
||||
const uint8_t mask_mplex_multi[] = {
|
||||
#include "mask_mplex_multi.lbm"
|
||||
};
|
||||
const uint8_t mask_mplex_replace[] = {
|
||||
#include "mask_mplex_replace.lbm"
|
||||
};
|
||||
const uint8_t mask_topleft[] = {
|
||||
#include "mask_topleft.lbm"
|
||||
};
|
||||
const uint8_t mask_edgetx[] = {
|
||||
#include "mask_edgetx.lbm"
|
||||
};
|
||||
const uint8_t mask_opentx_testmode[] = {
|
||||
#include "mask_opentx_testmode.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_calibration[] = {
|
||||
#include "mask_radio_calibration.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_global_functions[] = {
|
||||
#include "mask_radio_global_functions.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_hardware[] = {
|
||||
#include "mask_radio_hardware.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_sd_browser[] = {
|
||||
#include "mask_radio_sd_browser.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_setup[] = {
|
||||
#include "mask_radio_setup.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_tools[] = {
|
||||
#include "mask_radio_tools.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_trainer[] = {
|
||||
#include "mask_radio_trainer.lbm"
|
||||
};
|
||||
const uint8_t mask_radio_version[] = {
|
||||
#include "mask_radio_version.lbm"
|
||||
};
|
||||
const uint8_t mask_sbar_mixer[] = {
|
||||
#include "mask_sbar_mixer.lbm"
|
||||
};
|
||||
const uint8_t mask_sbar_output[] = {
|
||||
#include "mask_sbar_output.lbm"
|
||||
};
|
||||
const uint8_t mask_sbar_to[] = {
|
||||
#include "mask_sbar_to.lbm"
|
||||
};
|
||||
const uint8_t mask_stats_analogs[] = {
|
||||
#include "mask_stats_analogs.lbm"
|
||||
};
|
||||
const uint8_t mask_stats_debug[] = {
|
||||
#include "mask_stats_debug.lbm"
|
||||
};
|
||||
const uint8_t mask_stats_lua[] = {
|
||||
#include "mask_stats_lua.lbm"
|
||||
};
|
||||
const uint8_t mask_stats_throttle_graph[] = {
|
||||
#include "mask_stats_throttle_graph.lbm"
|
||||
};
|
||||
const uint8_t mask_stats_timers[] = {
|
||||
#include "mask_stats_timers.lbm"
|
||||
};
|
||||
const uint8_t mask_stats_value[] = {
|
||||
#include "mask_stats_value.lbm"
|
||||
};
|
||||
const uint8_t mask_switches[] = {
|
||||
#include "mask_switches.lbm"
|
||||
};
|
||||
const uint8_t mask_textline_curve[] = {
|
||||
#include "mask_textline_curve.lbm"
|
||||
};
|
||||
const uint8_t mask_textline_delay[] = {
|
||||
#include "mask_textline_delay.lbm"
|
||||
};
|
||||
const uint8_t mask_textline_delayslow[] = {
|
||||
#include "mask_textline_delayslow.lbm"
|
||||
};
|
||||
const uint8_t mask_textline_fm[] = {
|
||||
#include "mask_textline_fm.lbm"
|
||||
};
|
||||
const uint8_t mask_textline_label[] = {
|
||||
#include "mask_textline_label.lbm"
|
||||
};
|
||||
const uint8_t mask_textline_slow[] = {
|
||||
#include "mask_textline_slow.lbm"
|
||||
};
|
||||
const uint8_t mask_textline_switch[] = {
|
||||
#include "mask_textline_switch.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_add_view[] = {
|
||||
#include "mask_theme_add_view.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_setup[] = {
|
||||
#include "mask_theme_setup.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view1[] = {
|
||||
#include "mask_theme_view1.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view2[] = {
|
||||
#include "mask_theme_view2.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view3[] = {
|
||||
#include "mask_theme_view3.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view4[] = {
|
||||
#include "mask_theme_view4.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view5[] = {
|
||||
#include "mask_theme_view5.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view6[] = {
|
||||
#include "mask_theme_view6.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view7[] = {
|
||||
#include "mask_theme_view7.lbm"
|
||||
};
|
||||
const uint8_t mask_theme_view8[] = {
|
||||
#include "mask_theme_view8.lbm"
|
||||
};
|
||||
const uint8_t stick_pointer[] = {
|
||||
#include "alpha_stick_pointer.lbm"
|
||||
};
|
||||
const uint8_t stick_background[] = {
|
||||
#include "alpha_stick_background.lbm"
|
||||
};
|
||||
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"
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "opentx.h"
|
||||
#include "tabsgroup.h"
|
||||
#include "480_bitmaps.h"
|
||||
|
||||
const ZoneOption OPTIONS_THEME_DEFAULT[] = {
|
||||
{ STR_BACKGROUND_COLOR, ZoneOption::Color, OPTION_VALUE_UNSIGNED(WHITE) },
|
||||
@@ -80,10 +81,9 @@ class Theme480: public OpenTxTheme
|
||||
lcdColorTable[TRIM_SHADOW_COLOR_INDEX] = BLACK;
|
||||
}
|
||||
|
||||
void loadMenuIcon(uint8_t index, const char * filename, uint32_t color=MENU_COLOR) const
|
||||
void loadMenuIcon(uint8_t index, const uint8_t * lbm, uint32_t color=MENU_COLOR) const
|
||||
{
|
||||
TRACE("loadMenuIcon %s", getFilePath(filename));
|
||||
BitmapBuffer * mask = BitmapBuffer::loadMask(getFilePath(filename));
|
||||
BitmapBuffer * mask = BitmapBuffer::load8bitMask(lbm);
|
||||
if (mask) {
|
||||
delete iconMask[index];
|
||||
iconMask[index] = mask;
|
||||
@@ -107,76 +107,90 @@ class Theme480: public OpenTxTheme
|
||||
void loadIcons() const
|
||||
{
|
||||
#if defined(LOG_TELEMETRY) || !defined(WATCHDOG)
|
||||
loadMenuIcon(ICON_OPENTX, "mask_opentx_testmode.png", DEFAULT_COLOR);
|
||||
loadMenuIcon(ICON_OPENTX, mask_opentx_testmode, DEFAULT_COLOR);
|
||||
#else
|
||||
loadMenuIcon(ICON_OPENTX, "mask_edgetx.png");
|
||||
loadMenuIcon(ICON_OPENTX, mask_edgetx);
|
||||
#endif
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
loadMenuIcon(ICON_NEXT, "mask_next.png");
|
||||
loadMenuIcon(ICON_BACK, "mask_back.png");
|
||||
#if defined(HARDWARE_TOUCH) //TODO: get rid of, and use a real hitbox instead...
|
||||
loadMenuIcon(ICON_NEXT, mask_next);
|
||||
loadMenuIcon(ICON_BACK, mask_back);
|
||||
#endif
|
||||
loadMenuIcon(ICON_RADIO, "mask_menu_radio.png");
|
||||
loadMenuIcon(ICON_RADIO_SETUP, "mask_radio_setup.png");
|
||||
loadMenuIcon(ICON_RADIO_SD_MANAGER, "mask_radio_sd_browser.png");
|
||||
loadMenuIcon(ICON_RADIO_TOOLS, "mask_radio_tools.png");
|
||||
loadMenuIcon(ICON_RADIO_SPECTRUM_ANALYSER, "/mask_radio_spectrum_analyser.png");
|
||||
loadMenuIcon(ICON_RADIO_GLOBAL_FUNCTIONS, "mask_radio_global_functions.png");
|
||||
loadMenuIcon(ICON_RADIO_TRAINER, "mask_radio_trainer.png");
|
||||
loadMenuIcon(ICON_RADIO_HARDWARE, "mask_radio_hardware.png");
|
||||
loadMenuIcon(ICON_RADIO_CALIBRATION, "mask_radio_calibration.png");
|
||||
loadMenuIcon(ICON_RADIO_VERSION, "mask_radio_version.png");
|
||||
loadMenuIcon(ICON_MODEL, "mask_menu_model.png");
|
||||
loadMenuIcon(ICON_MODEL_SETUP, "mask_model_setup.png");
|
||||
loadMenuIcon(ICON_MODEL_HELI, "mask_model_heli.png");
|
||||
loadMenuIcon(ICON_MODEL_FLIGHT_MODES, "mask_model_flight_modes.png");
|
||||
loadMenuIcon(ICON_MODEL_INPUTS, "mask_model_inputs.png");
|
||||
loadMenuIcon(ICON_MODEL_MIXER, "mask_model_mixer.png");
|
||||
loadMenuIcon(ICON_MODEL_OUTPUTS, "mask_model_outputs.png");
|
||||
loadMenuIcon(ICON_MODEL_CURVES, "mask_model_curves.png");
|
||||
loadMenuIcon(ICON_MODEL_GVARS, "mask_model_gvars.png");
|
||||
loadMenuIcon(ICON_MODEL_LOGICAL_SWITCHES, "mask_model_logical_switches.png");
|
||||
loadMenuIcon(ICON_MODEL_SPECIAL_FUNCTIONS, "mask_model_special_functions.png");
|
||||
loadMenuIcon(ICON_MODEL_LUA_SCRIPTS, "mask_model_lua_scripts.png");
|
||||
loadMenuIcon(ICON_MODEL_TELEMETRY, "mask_model_telemetry.png");
|
||||
loadMenuIcon(ICON_STATS, "mask_menu_stats.png");
|
||||
loadMenuIcon(ICON_STATS_THROTTLE_GRAPH, "mask_stats_throttle_graph.png");
|
||||
loadMenuIcon(ICON_STATS_TIMERS, "mask_stats_timers.png");
|
||||
loadMenuIcon(ICON_STATS_ANALOGS, "mask_stats_analogs.png");
|
||||
loadMenuIcon(ICON_STATS_DEBUG, "mask_stats_debug.png");
|
||||
loadMenuIcon(ICON_THEME, "mask_menu_theme.png");
|
||||
loadMenuIcon(ICON_THEME_SETUP, "mask_theme_setup.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW1, "mask_theme_view1.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW2, "mask_theme_view2.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW3, "mask_theme_view3.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW4, "mask_theme_view4.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW5, "mask_theme_view5.png");
|
||||
loadMenuIcon(ICON_THEME_ADD_VIEW, "mask_theme_add_view.png");
|
||||
loadMenuIcon(ICON_MONITOR, "mask_monitor.png");
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS1, "mask_monitor_channels1.png");
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS2, "mask_monitor_channels2.png");
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS3, "mask_monitor_channels3.png");
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS4, "mask_monitor_channels4.png");
|
||||
loadMenuIcon(ICON_MONITOR_LOGICAL_SWITCHES, "mask_monitor_logsw.png");
|
||||
loadMenuIcon(ICON_RADIO, mask_menu_radio);
|
||||
loadMenuIcon(ICON_RADIO_SETUP, mask_radio_setup);
|
||||
loadMenuIcon(ICON_RADIO_SD_MANAGER, mask_radio_sd_browser);
|
||||
loadMenuIcon(ICON_RADIO_TOOLS, mask_radio_tools);
|
||||
//loadMenuIcon(ICON_RADIO_SPECTRUM_ANALYSER, mask_radio_spectrum_analyser);
|
||||
loadMenuIcon(ICON_RADIO_GLOBAL_FUNCTIONS, mask_radio_global_functions);
|
||||
loadMenuIcon(ICON_RADIO_TRAINER, mask_radio_trainer);
|
||||
loadMenuIcon(ICON_RADIO_HARDWARE, mask_radio_hardware);
|
||||
loadMenuIcon(ICON_RADIO_CALIBRATION, mask_radio_calibration);
|
||||
loadMenuIcon(ICON_RADIO_VERSION, mask_radio_version);
|
||||
loadMenuIcon(ICON_MODEL, mask_menu_model);
|
||||
loadMenuIcon(ICON_MODEL_SETUP, mask_model_setup);
|
||||
loadMenuIcon(ICON_MODEL_HELI, mask_model_heli);
|
||||
loadMenuIcon(ICON_MODEL_FLIGHT_MODES, mask_model_flight_modes);
|
||||
loadMenuIcon(ICON_MODEL_INPUTS, mask_model_inputs);
|
||||
loadMenuIcon(ICON_MODEL_MIXER, mask_model_mixer);
|
||||
loadMenuIcon(ICON_MODEL_OUTPUTS, mask_model_outputs);
|
||||
loadMenuIcon(ICON_MODEL_CURVES, mask_model_curves);
|
||||
loadMenuIcon(ICON_MODEL_GVARS, mask_model_gvars);
|
||||
loadMenuIcon(ICON_MODEL_LOGICAL_SWITCHES, mask_model_logical_switches);
|
||||
loadMenuIcon(ICON_MODEL_SPECIAL_FUNCTIONS, mask_model_special_functions);
|
||||
loadMenuIcon(ICON_MODEL_LUA_SCRIPTS, mask_model_lua_scripts);
|
||||
loadMenuIcon(ICON_MODEL_TELEMETRY, mask_model_telemetry);
|
||||
loadMenuIcon(ICON_STATS, mask_menu_stats);
|
||||
loadMenuIcon(ICON_STATS_THROTTLE_GRAPH, mask_stats_throttle_graph);
|
||||
loadMenuIcon(ICON_STATS_TIMERS, mask_stats_timers);
|
||||
loadMenuIcon(ICON_STATS_ANALOGS, mask_stats_analogs);
|
||||
loadMenuIcon(ICON_STATS_DEBUG, mask_stats_debug);
|
||||
loadMenuIcon(ICON_THEME, mask_menu_theme);
|
||||
loadMenuIcon(ICON_THEME_SETUP, mask_theme_setup);
|
||||
loadMenuIcon(ICON_THEME_VIEW1, mask_theme_view1);
|
||||
loadMenuIcon(ICON_THEME_VIEW2, mask_theme_view2);
|
||||
loadMenuIcon(ICON_THEME_VIEW3, mask_theme_view3);
|
||||
loadMenuIcon(ICON_THEME_VIEW4, mask_theme_view4);
|
||||
loadMenuIcon(ICON_THEME_VIEW5, mask_theme_view5);
|
||||
loadMenuIcon(ICON_THEME_ADD_VIEW, mask_theme_add_view);
|
||||
loadMenuIcon(ICON_MONITOR, mask_monitor);
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS1, mask_monitor_channels1);
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS2, mask_monitor_channels2);
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS3, mask_monitor_channels3);
|
||||
loadMenuIcon(ICON_MONITOR_CHANNELS4, mask_monitor_channels4);
|
||||
loadMenuIcon(ICON_MONITOR_LOGICAL_SWITCHES, mask_monitor_logsw);
|
||||
|
||||
BitmapBuffer * background = BitmapBuffer::loadMask(getFilePath("mask_currentmenu_bg.png"));
|
||||
BitmapBuffer * shadow = BitmapBuffer::loadMask(getFilePath("mask_currentmenu_shadow.png"));
|
||||
BitmapBuffer * dot = BitmapBuffer::loadMask(getFilePath("mask_currentmenu_dot.png"));
|
||||
BitmapBuffer * background = BitmapBuffer::load8bitMask(mask_currentmenu_bg);
|
||||
BitmapBuffer * shadow = BitmapBuffer::load8bitMask(mask_currentmenu_shadow);
|
||||
BitmapBuffer * dot = BitmapBuffer::load8bitMask(mask_currentmenu_dot);
|
||||
|
||||
if (!currentMenuBackground) {
|
||||
currentMenuBackground = new BitmapBuffer(BMP_RGB565, 36, 53);
|
||||
}
|
||||
|
||||
if (currentMenuBackground) {
|
||||
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->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);
|
||||
}
|
||||
|
||||
delete topleftBitmap;
|
||||
topleftBitmap = BitmapBuffer::loadMaskOnBackground(getFilePath("topleft.png"), TITLE_BGCOLOR, HEADER_COLOR);
|
||||
topleftBitmap = BitmapBuffer::load8bitMaskOnBackground(
|
||||
mask_topleft, TITLE_BGCOLOR, HEADER_COLOR);
|
||||
|
||||
delete background;
|
||||
delete shadow;
|
||||
@@ -187,50 +201,45 @@ class Theme480: public OpenTxTheme
|
||||
{
|
||||
// Calibration screen
|
||||
delete calibStick;
|
||||
calibStick = BitmapBuffer::loadBitmap(getFilePath("stick_pointer.png"));
|
||||
calibStick =
|
||||
BitmapBuffer::loadRamBitmap(stick_pointer, sizeof(stick_pointer));
|
||||
|
||||
delete calibStickBackground;
|
||||
calibStickBackground = BitmapBuffer::loadBitmap(getFilePath("stick_background.png"));
|
||||
calibStickBackground = BitmapBuffer::loadRamBitmap(
|
||||
stick_background, sizeof(stick_background));
|
||||
|
||||
delete calibTrackpBackground;
|
||||
calibTrackpBackground = BitmapBuffer::loadBitmap(getFilePath("trackp_background.png"));
|
||||
|
||||
delete calibRadioPict;
|
||||
#if defined(PCBX10)
|
||||
if(STICKS_PWM_ENABLED()) {
|
||||
calibRadioPict = BitmapBuffer::loadBitmap(getFilePath("X10S.bmp"));
|
||||
}
|
||||
else {
|
||||
calibRadioPict = BitmapBuffer::loadBitmap(getFilePath("X10.bmp"));
|
||||
}
|
||||
#else
|
||||
calibRadioPict = BitmapBuffer::loadBitmap(getFilePath("horus.bmp"));
|
||||
#endif
|
||||
calibTrackpBackground = BitmapBuffer::loadRamBitmap(
|
||||
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"));
|
||||
|
||||
@@ -325,8 +334,7 @@ class Theme480: public OpenTxTheme
|
||||
dc->drawBitmap(0 - dc->getOffsetX(), 0 - dc->getOffsetY(), backgroundBitmap);
|
||||
}
|
||||
else {
|
||||
lcdSetColor(g_eeGeneral.themeData.options[0].value.unsignedValue);
|
||||
dc->drawSolidFilledRect(0, 0, LCD_W, LCD_H, CUSTOM_COLOR);
|
||||
dc->drawSolidFilledRect(0, 0, LCD_W, LCD_H, DEFAULT_BGCOLOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,17 +215,14 @@ class FlyskyTheme: public OpenTxTheme
|
||||
delete calibTrackpBackground;
|
||||
calibTrackpBackground = BitmapBuffer::loadBitmap(getFilePath("trackp_background.png"));
|
||||
|
||||
delete calibRadioPict;
|
||||
calibRadioPict = BitmapBuffer::loadBitmap(getFilePath("NV14.bmp"));
|
||||
|
||||
// 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"));
|
||||
|
||||
Reference in New Issue
Block a user