Fixed formatting and added default case
The default case acts like the system theme is the dark one, because who really use the light theme?
This commit is contained in:
parent
e42df316d7
commit
3ae331a2b5
@ -11,4 +11,3 @@ Build with ```make nx``` or just run ```make```.
|
||||
|
||||
* This uses code based on 3DS [new-hbmenu](https://github.com/fincs/new-hbmenu).
|
||||
* [nanojpeg](https://svn.emphy.de/nanojpeg/trunk/nanojpeg/nanojpeg.c) is used for handling JPEG icons. This library doesn't support lossless JPEG.
|
||||
|
||||
|
@ -29,6 +29,7 @@ void themeStartup(ThemePreset preset) {
|
||||
//.buttonBImage = button_b_light_bin,
|
||||
.hbmenuLogoImage = hbmenu_logo_light_bin
|
||||
};
|
||||
|
||||
theme_t themeDark = (theme_t) {
|
||||
.textColor = MakeColor(255, 255, 255, 255),
|
||||
.frontWaveColor = MakeColor(96, 204, 204, 255),
|
||||
@ -44,6 +45,7 @@ void themeStartup(ThemePreset preset) {
|
||||
//.buttonBImage = button_b_dark_bin,
|
||||
.hbmenuLogoImage = hbmenu_logo_dark_bin
|
||||
};
|
||||
|
||||
theme_t *themeDefault;
|
||||
config_t *cfg = NULL;
|
||||
cfg = (config_t *) malloc(sizeof(config_t));
|
||||
@ -53,6 +55,7 @@ void themeStartup(ThemePreset preset) {
|
||||
int waveBlending;
|
||||
const char *AText, *BText;
|
||||
bool good_cfg=config_read_file(cfg, "/hbtheme.cfg");
|
||||
|
||||
switch (preset) {
|
||||
case THEME_PRESET_LIGHT:
|
||||
themeDefault = &themeLight;
|
||||
@ -65,7 +68,12 @@ void themeStartup(ThemePreset preset) {
|
||||
if (good_cfg)
|
||||
theme = config_lookup(cfg, "darkTheme");
|
||||
break;
|
||||
default:
|
||||
themeDefault = &themeDark;
|
||||
if (good_cfg)
|
||||
theme = config_lookup(cfg, "darkTheme");
|
||||
}
|
||||
|
||||
if (good_cfg){
|
||||
if (theme != NULL) {
|
||||
if (!colorFromSetting(config_setting_lookup(theme, "textColor"), &text))
|
||||
|
Loading…
Reference in New Issue
Block a user