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).
|
* 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.
|
* [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,
|
//.buttonBImage = button_b_light_bin,
|
||||||
.hbmenuLogoImage = hbmenu_logo_light_bin
|
.hbmenuLogoImage = hbmenu_logo_light_bin
|
||||||
};
|
};
|
||||||
|
|
||||||
theme_t themeDark = (theme_t) {
|
theme_t themeDark = (theme_t) {
|
||||||
.textColor = MakeColor(255, 255, 255, 255),
|
.textColor = MakeColor(255, 255, 255, 255),
|
||||||
.frontWaveColor = MakeColor(96, 204, 204, 255),
|
.frontWaveColor = MakeColor(96, 204, 204, 255),
|
||||||
@ -44,6 +45,7 @@ void themeStartup(ThemePreset preset) {
|
|||||||
//.buttonBImage = button_b_dark_bin,
|
//.buttonBImage = button_b_dark_bin,
|
||||||
.hbmenuLogoImage = hbmenu_logo_dark_bin
|
.hbmenuLogoImage = hbmenu_logo_dark_bin
|
||||||
};
|
};
|
||||||
|
|
||||||
theme_t *themeDefault;
|
theme_t *themeDefault;
|
||||||
config_t *cfg = NULL;
|
config_t *cfg = NULL;
|
||||||
cfg = (config_t *) malloc(sizeof(config_t));
|
cfg = (config_t *) malloc(sizeof(config_t));
|
||||||
@ -53,6 +55,7 @@ void themeStartup(ThemePreset preset) {
|
|||||||
int waveBlending;
|
int waveBlending;
|
||||||
const char *AText, *BText;
|
const char *AText, *BText;
|
||||||
bool good_cfg=config_read_file(cfg, "/hbtheme.cfg");
|
bool good_cfg=config_read_file(cfg, "/hbtheme.cfg");
|
||||||
|
|
||||||
switch (preset) {
|
switch (preset) {
|
||||||
case THEME_PRESET_LIGHT:
|
case THEME_PRESET_LIGHT:
|
||||||
themeDefault = &themeLight;
|
themeDefault = &themeLight;
|
||||||
@ -65,9 +68,14 @@ void themeStartup(ThemePreset preset) {
|
|||||||
if (good_cfg)
|
if (good_cfg)
|
||||||
theme = config_lookup(cfg, "darkTheme");
|
theme = config_lookup(cfg, "darkTheme");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
themeDefault = &themeDark;
|
||||||
|
if (good_cfg)
|
||||||
|
theme = config_lookup(cfg, "darkTheme");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (good_cfg){
|
if (good_cfg){
|
||||||
if (theme !=NULL){
|
if (theme != NULL) {
|
||||||
if (!colorFromSetting(config_setting_lookup(theme, "textColor"), &text))
|
if (!colorFromSetting(config_setting_lookup(theme, "textColor"), &text))
|
||||||
text = themeDefault->textColor;
|
text = themeDefault->textColor;
|
||||||
if (!colorFromSetting(config_setting_lookup(theme, "frontWaveColor"), &frontWave))
|
if (!colorFromSetting(config_setting_lookup(theme, "frontWaveColor"), &frontWave))
|
||||||
|
Loading…
Reference in New Issue
Block a user