[Horus] UI continued

This commit is contained in:
Bertrand Songis
2016-03-01 23:47:11 +01:00
parent 23e597fffe
commit b5f6618238
18 changed files with 241 additions and 138 deletions
+13 -3
View File
@@ -64,11 +64,15 @@ class DefaultTheme: public Theme
lcdColorTable[HEADER_ICON_BGCOLOR_INDEX] = RED;
lcdColorTable[HEADER_CURRENT_BGCOLOR_INDEX] = RED;
lcdColorTable[OVERLAY_COLOR_INDEX] = BLACK;
Theme::load();
if (!backgroundBitmap) backgroundBitmap = BitmapBuffer::load(getThemePath("mainbg.bmp"));
if (!aboutBackgroundBitmap) aboutBackgroundBitmap = BitmapBuffer::load(getThemePath("aboutbg.bmp"));
}
virtual void drawBackground() const
{
static BitmapBuffer * backgroundBitmap = BitmapBuffer::load(getThemePath("mainbg.bmp"));
if (backgroundBitmap) {
lcd->drawBitmap(0, 0, backgroundBitmap);
}
@@ -80,8 +84,7 @@ class DefaultTheme: public Theme
virtual void drawAboutBackground() const
{
static BitmapBuffer * backgroundBitmap = BitmapBuffer::load(getThemePath("aboutbg.bmp"));
lcd->drawBitmap(0, 0, backgroundBitmap);
lcd->drawBitmap(0, 0, aboutBackgroundBitmap);
}
virtual void drawTopbarBackground(const uint8_t * icon) const
@@ -98,7 +101,14 @@ class DefaultTheme: public Theme
drawTopbarDatetime();
}
protected:
static const BitmapBuffer * backgroundBitmap;
static const BitmapBuffer * aboutBackgroundBitmap;
};
const BitmapBuffer * DefaultTheme::backgroundBitmap = NULL;
const BitmapBuffer * DefaultTheme::aboutBackgroundBitmap = NULL;
DefaultTheme defaultTheme;
Theme * theme = &defaultTheme;