Added "USB plugged" screen
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -37,6 +37,13 @@ const uint8_t LBM_DROPDOWN[] = {
|
||||
#include "mask_dropdown.lbm"
|
||||
};
|
||||
|
||||
constexpr coord_t LBM_USB_PLUGGED_W = 211;
|
||||
constexpr coord_t LBM_USB_PLUGGED_H = 110;
|
||||
|
||||
const uint8_t LBM_USB_PLUGGED[] = {
|
||||
#include "mask_usb_symbol.lbm"
|
||||
};
|
||||
|
||||
std::list<OpenTxTheme *> & getRegisteredThemes()
|
||||
{
|
||||
static std::list<OpenTxTheme *> themes;
|
||||
@@ -204,6 +211,16 @@ void OpenTxTheme::drawSlider(BitmapBuffer * dc, int vmin, int vmax, int value, c
|
||||
}
|
||||
}
|
||||
|
||||
void OpenTxTheme::drawUsbPluggedScreen(BitmapBuffer * dc) const
|
||||
{
|
||||
// draw USB icon
|
||||
dc->clear(DEFAULT_BGCOLOR);
|
||||
dc->drawBitmapPattern((LCD_W - LBM_USB_PLUGGED_W) / 2,
|
||||
(LCD_H - LBM_USB_PLUGGED_H) / 2,
|
||||
LBM_USB_PLUGGED, DEFAULT_COLOR);
|
||||
}
|
||||
|
||||
|
||||
OpenTxTheme * getTheme(const char * name)
|
||||
{
|
||||
std::list<OpenTxTheme *>::const_iterator it = getRegisteredThemes().cbegin();
|
||||
|
||||
@@ -100,6 +100,9 @@ class OpenTxTheme: public Theme
|
||||
|
||||
virtual void drawTopLeftBitmap(BitmapBuffer * dc) const = 0;
|
||||
|
||||
virtual void drawUsbPluggedScreen(BitmapBuffer * dc) const;
|
||||
|
||||
|
||||
protected:
|
||||
const char * name;
|
||||
const ZoneOption * options;
|
||||
|
||||
+5
-1
@@ -474,7 +474,11 @@ void perMain()
|
||||
#if defined(STM32)
|
||||
if (usbPlugged() && getSelectedUsbMode() == USB_MASS_STORAGE_MODE) {
|
||||
#if defined(LIBOPENUI)
|
||||
#warning "TODO USB plugged view"
|
||||
// draw some image showing USB
|
||||
lcdNextLayer();
|
||||
lcd->reset();
|
||||
OpenTxTheme::instance()->drawUsbPluggedScreen(lcd);
|
||||
lcdRefresh();
|
||||
#else
|
||||
// disable access to menus
|
||||
lcdClear();
|
||||
|
||||
Reference in New Issue
Block a user