Cosmetics

This commit is contained in:
Bertrand Songis
2016-02-20 17:34:47 +01:00
parent 701d02ba8e
commit 401f0f2a4f
+22 -9
View File
@@ -28,11 +28,22 @@ const uint8_t LBM_MAINVIEW_BACKGROUND[] = {
#include "bmp_background.lbm" #include "bmp_background.lbm"
}; };
const uint8_t LBM_THEME_DEFAULT[] __DMA = {
#include "bmp_default.lbm"
};
const ZoneOption OPTIONS_THEME_DEFAULT[] = {
{ "Default background", ZoneOption::Bool, { .boolValue = 1 } },
{ "Background file", ZoneOption::File, { .stringValue = "\0\0\0\0\0\0\0" } },
{ "Background color", ZoneOption::Color, { .unsignedValue = RGB(180, 190, 230) } },
{ NULL, ZoneOption::Bool }
};
class DefaultTheme: public Theme class DefaultTheme: public Theme
{ {
public: public:
DefaultTheme(const char * name, const uint8_t * bitmap): DefaultTheme():
Theme(name, bitmap) Theme("Default", LBM_THEME_DEFAULT, OPTIONS_THEME_DEFAULT)
{ {
} }
@@ -67,7 +78,13 @@ class DefaultTheme: public Theme
virtual void drawBackground() const virtual void drawBackground() const
{ {
lcdDrawBitmap(0, 0, LBM_MAINVIEW_BACKGROUND); if (g_eeGeneral.themeData.options[0].boolValue) {
lcdDrawBitmap(0, 0, LBM_MAINVIEW_BACKGROUND);
}
else {
lcdSetColor(g_eeGeneral.themeData.options[2].unsignedValue);
lcdDrawSolidFilledRect(0, 0, LCD_W, LCD_H, CUSTOM_COLOR);
}
} }
virtual void drawTopbarBackground(const uint8_t * icon) const virtual void drawTopbarBackground(const uint8_t * icon) const
@@ -86,9 +103,5 @@ class DefaultTheme: public Theme
} }
}; };
const uint8_t LBM_THEME_DEFAULT[] __DMA = { const DefaultTheme defaultTheme;
#include "bmp_default.lbm" const Theme * theme = &defaultTheme;
};
const DefaultTheme defaultTheme("Default", LBM_THEME_DEFAULT);
const Theme * theme = &defaultTheme;