From e683addf25d72b4f1ac70d95687b4ceed69e591e Mon Sep 17 00:00:00 2001 From: Daniel Bernard Date: Sun, 7 Oct 2018 21:52:51 -0500 Subject: [PATCH] Add battery icon and shift charge text as required --- common/menu.c | 8 ++++++-- data/battery_icon.bin | Bin 0 -> 179200 bytes resources/battery_icon.png | Bin 0 -> 876 bytes 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 data/battery_icon.bin create mode 100644 resources/battery_icon.png diff --git a/common/menu.c b/common/menu.c index 95a1f2c..31657fa 100644 --- a/common/menu.c +++ b/common/menu.c @@ -7,6 +7,7 @@ #include "theme_icon_dark_bin.h" #include "theme_icon_light_bin.h" #include "charging_icon_bin.h" +#include "battery_icon_bin.h" char rootPathBase[PATH_MAX]; char rootPath[PATH_MAX+8]; @@ -337,6 +338,7 @@ void menuStartupPath(void) { } uint8_t *charging_icon_small; +uint8_t *battery_icon_small; void menuStartup(void) { menuScan(rootPath); @@ -348,6 +350,7 @@ void menuStartup(void) { else theme_icon_small = downscaleImg(theme_icon_light_bin, 256, 256, 140, 140, IMAGE_MODE_RGB24); charging_icon_small = downscaleImg(charging_icon_bin, 155, 256, 9, 15, IMAGE_MODE_RGBA32); + battery_icon_small = downscaleImg(battery_icon_bin, 175, 256, 10, 15, IMAGE_MODE_RGBA32); computeFrontGradient(themeCurrent.frontWaveColor, 280); //menuCreateMsgBox(780, 300, "This is a test"); } @@ -437,9 +440,10 @@ void drawCharge() { int tmpX = GetTextXCoordinate(interuiregular14, 1180, chargeString, 'r'); - DrawText(interuiregular14, tmpX, 0 + 47 + 10 + 21, themeCurrent.textColor, chargeString); + DrawText(interuiregular14, tmpX - 15, 0 + 47 + 10 + 21, themeCurrent.textColor, chargeString); + drawIcon(1180 - 11, 0 + 47 + 10 + 6, 10, 15, battery_icon_small, themeCurrent.textColor); if (isCharging) - drawIcon(tmpX - 20, 0 + 47 + 10 + 5, 9, 15, charging_icon_small, themeCurrent.textColor); + drawIcon(tmpX - 35, 0 + 47 + 10 + 5, 9, 15, charging_icon_small, themeCurrent.textColor); } void drawBackBtn(menu_s* menu, bool emptyDir) { diff --git a/data/battery_icon.bin b/data/battery_icon.bin new file mode 100644 index 0000000000000000000000000000000000000000..651b502fa76426d7c61ae1cebbf9469439a0bca1 GIT binary patch literal 179200 zcmeI(u?>JQ5Cg!>#L%q3c#sT0WhqW^ky0V-*Xt-51U3NS2@>X`)%@uVL*k!jPFK=a+-CR*8fn9bx^72-8 z+07Mo64+(;Pu@KroP3`-pa0eN?_llyWEX2TF6@8-1{h#~0R|XgfB^;=V1NMz7+`<_ z1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;= zV1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~ z0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz z7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|Xg zfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_ z1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;= zV1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~ z0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz z7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|Xg zfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_ z1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;= zV1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~ z0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz z7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|Xg zfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=V1NMz7+`<_1{h#~0R|XgfB^;=IMl!g81Cev literal 0 HcmV?d00001 diff --git a/resources/battery_icon.png b/resources/battery_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a33daaacd3cc00b1e81732e3f6ccc3014545c008 GIT binary patch literal 876 zcmeAS@N?(olHy`uVBq!ia0vp^>lqjr893O0tfTAIegP?#VkgfK4j`!ENa+CbISV`@ ziy0WTH9(m0V)2}lKtah8*NBqf{Irtt#G+J&^73-M%)IR4`Q0PeEmxB wyv(zYH~ETeq)!l~pLm-_RT2{)BP^84wKb9qFIVic2j&b0Pgg&ebxsLQ0J{i->i_@% literal 0 HcmV?d00001