diff --git a/assets/star_off.bin b/assets/star_off.bin deleted file mode 100644 index 20b455c..0000000 Binary files a/assets/star_off.bin and /dev/null differ diff --git a/assets/star_on.bin b/assets/star_on.bin deleted file mode 100644 index 2922b05..0000000 Binary files a/assets/star_on.bin and /dev/null differ diff --git a/assets/star_small.bin b/assets/star_small.bin deleted file mode 100644 index dbec733..0000000 Binary files a/assets/star_small.bin and /dev/null differ diff --git a/common/assets.c b/common/assets.c index 8680ca3..e3cc541 100644 --- a/common/assets.c +++ b/common/assets.c @@ -27,9 +27,6 @@ assetsDataEntry g_assetsDataList[AssetId_Max] = { GENASSET("wifi3_icon.bin"), GENASSET("eth_icon.bin"), GENASSET("eth_none_icon.bin"), - GENASSET("star_small.bin"), - GENASSET("star_on.bin"), - GENASSET("star_off.bin"), }; static void assetsClearEntry(assetsDataEntry *entry) { diff --git a/common/assets.h b/common/assets.h index fed4a66..6eb23e2 100644 --- a/common/assets.h +++ b/common/assets.h @@ -17,9 +17,6 @@ typedef enum { AssetId_wifi3_icon, AssetId_eth_icon, AssetId_eth_none_icon, - AssetId_star_small, - AssetId_star_on, - AssetId_star_off, AssetId_Max } AssetId; diff --git a/common/font.c b/common/font.c index 43fd442..803cad9 100644 --- a/common/font.c +++ b/common/font.c @@ -43,6 +43,10 @@ static bool FontSetType(u32 font) case interuimedium30: scale = 8; break; + + case largestar: + scale = 18; + break; default: return false; diff --git a/common/font.h b/common/font.h index 45ed8fe..fb9d300 100644 --- a/common/font.h +++ b/common/font.h @@ -43,3 +43,4 @@ extern const ffnt_header_t interuiregular18_nxfnt;*/ #define interuiregular14 0//&interuiregular14_nxfnt #define interuiregular18 1//&interuiregular18_nxfnt #define fontscale7 4 +#define largestar 5 diff --git a/common/menu.c b/common/menu.c index 9201ad4..c1dabc7 100644 --- a/common/menu.c +++ b/common/menu.c @@ -294,7 +294,7 @@ static void drawEntry(menuEntry_s* me, int off_x, int is_active) { if (smallimg) { drawImage(start_x, start_y + 32, 140, 140, smallimg, IMAGE_MODE_RGB24); if (me->starred) - drawImage(start_x + 105 + 12, start_y - 12, 35, 33, themeCurrent.starSmallImage, IMAGE_MODE_RGBA32); + DrawText(interuimedium30, start_x + 105 + 16, start_y + 16, themeCurrent.borderTextColor, themeCurrent.labelStarOnText); } if (is_active && largeimg) { @@ -335,10 +335,10 @@ static void drawEntry(menuEntry_s* me, int off_x, int is_active) { if (me->starred) { - drawImage(start_x - 64, 100, 64, 61, themeCurrent.starOnImage, IMAGE_MODE_RGBA32); + DrawText(largestar, start_x - 68, 160, themeCurrent.textColor, themeCurrent.labelStarOnText); } else { if (smallimg != theme_icon_small)//if (me->type != ENTRY_TYPE_THEME) <- why this crash? - drawImage(start_x - 64, 100, 64, 61, themeCurrent.starOffImage, IMAGE_MODE_RGBA32); + DrawText(largestar, start_x - 68, 160, themeCurrent.textColor, themeCurrent.labelStarOffText); } } } diff --git a/common/theme.c b/common/theme.c index 7b0bfd7..bdc13af 100644 --- a/common/theme.c +++ b/common/theme.c @@ -30,10 +30,9 @@ void themeStartup(ThemePreset preset) { .buttonYText = "\uE0E3", .buttonPText = "\uE0EF", .buttonMText = "\uE0F0", + .labelStarOnText = "\u2605", + .labelStarOffText = "\u2606", .hbmenuLogoImage = assetsGetDataBuffer(AssetId_hbmenu_logo_light), - .starSmallImage = assetsGetDataBuffer(AssetId_star_small), - .starOnImage = assetsGetDataBuffer(AssetId_star_on), - .starOffImage = assetsGetDataBuffer(AssetId_star_off) }; theme_t themeDark = (theme_t) { @@ -54,10 +53,9 @@ void themeStartup(ThemePreset preset) { .buttonYText = "\uE0A3", .buttonPText = "\uE0B3", .buttonMText = "\uE0B4", + .labelStarOnText = "\u2605", + .labelStarOffText = "\u2606", .hbmenuLogoImage = assetsGetDataBuffer(AssetId_hbmenu_logo_dark), - .starSmallImage = assetsGetDataBuffer(AssetId_star_small), - .starOnImage = assetsGetDataBuffer(AssetId_star_on), - .starOffImage = assetsGetDataBuffer(AssetId_star_off) }; char themePath[PATH_MAX] = {0}; @@ -69,7 +67,7 @@ void themeStartup(ThemePreset preset) { config_setting_t *theme = NULL; color_t text, frontWave, middleWave, backWave, background, highlight, separator, borderColor, borderTextColor, progressBarColor; int waveBlending; - const char *AText, *BText, *XText, *YText, *PText, *MText; + const char *AText, *BText, *XText, *YText, *PText, *MText, *starOnText, *starOffText; bool good_cfg = false; if(themePath[0]!=0) @@ -126,7 +124,11 @@ void themeStartup(ThemePreset preset) { PText = themeDefault->buttonPText; if (!config_setting_lookup_string(theme, "buttonMText", &MText)) MText = themeDefault->buttonMText; - themeCurrent = (theme_t) { + if (!config_setting_lookup_string(theme, "labelStarOnText", &starOnText)) + starOnText = themeDefault->labelStarOnText; + if (!config_setting_lookup_string(theme, "labelStarOffText", &starOffText)) + starOffText = themeDefault->labelStarOffText; + themeCurrent = (theme_t) { .textColor = text, .frontWaveColor = frontWave, .middleWaveColor = middleWave, diff --git a/common/theme.h b/common/theme.h index 5869f4a..9ccecd6 100644 --- a/common/theme.h +++ b/common/theme.h @@ -22,10 +22,9 @@ typedef struct char buttonYText[32]; char buttonPText[32]; char buttonMText[32]; + char labelStarOnText[32]; + char labelStarOffText[32]; const uint8_t *hbmenuLogoImage; - const uint8_t *starSmallImage; - const uint8_t *starOnImage; - const uint8_t *starOffImage; } theme_t; typedef enum diff --git a/resources/star_off.png b/resources/star_off.png deleted file mode 100644 index e52b4e1..0000000 Binary files a/resources/star_off.png and /dev/null differ diff --git a/resources/star_on.png b/resources/star_on.png deleted file mode 100644 index d1788c7..0000000 Binary files a/resources/star_on.png and /dev/null differ diff --git a/resources/star_small.png b/resources/star_small.png deleted file mode 100644 index 40523bb..0000000 Binary files a/resources/star_small.png and /dev/null differ