InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

colored battery icon "juice"

Open mashuptwice opened this issue 3 years ago • 9 comments

Battery status icon "juice" colored depending on the reported battery percentage. This is a first attempt to introduce a few colored elements into the UI, in accordance with some of the reactions to #1265

>=60 GREEN
>40 && <60 ORANGE
<=40 RED

6pnwi3

mashuptwice avatar Aug 11 '22 21:08 mashuptwice

@FintasticMan thanks for the suggestion!

Also fixed the formatting issue preventing the workflows from succeding.

ghost avatar Aug 14 '22 14:08 ghost

doesn't build in InfiniSim

/home/runner/work/InfiniTime/InfiniTime/src/displayapp/screens/BatteryIcon.cpp: In member function ‘void Pinetime::Applications::Screens::BatteryIcon::SetBatteryPercentage(uint8_t)’:
/home/runner/work/InfiniTime/InfiniTime/src/displayapp/screens/BatteryIcon.cpp:31:87: error: ‘LV_COLOR_LIGHT_GREEN’ was not declared in this scope; did you mean ‘LV_COLOR_GREEN’?
   31 |     lv_obj_set_style_local_bg_color(batteryJuice, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_LIGHT_GREEN);
      |                                                                                       ^~~~~~~~~~~~~~~~~~~~
      |                                                                                       LV_COLOR_GREEN

and not as firmware

[ 41%] Building CXX object src/CMakeFiles/pinetime-app.dir/displayapp/screens/BleIcon.cpp.o
/__w/InfiniTime/InfiniTime/src/displayapp/screens/BatteryIcon.cpp: In member function 'void Pinetime::Applications::Screens::BatteryIcon::SetBatteryPercentage(uint8_t)':
/__w/InfiniTime/InfiniTime/src/displayapp/screens/BatteryIcon.cpp:31:87: error: 'LV_COLOR_LIGHT_GREEN' was not declared in this scope; did you mean 'LV_COLOR_GREEN'?
   31 |     lv_obj_set_style_local_bg_color(batteryJuice, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_LIGHT_GREEN);
      |                                                                                       ^~~~~~~~~~~~~~~~~~~~
      |                                                                                       LV_COLOR_GREEN
gmake[2]: *** [src/CMakeFiles/pinetime-app.dir/build.make:202: src/CMakeFiles/pinetime-app.dir/displayapp/screens/BatteryIcon.cpp.o] Error 1

NeroBurner avatar Aug 15 '22 12:08 NeroBurner

Oh, oops. I read the lvgl documentation wrong. It should be either LV_COLOR_LIME or LV_COLOR_GREEN, depending on what looks better. I think lime would probably be best.

FintasticMan avatar Aug 15 '22 12:08 FintasticMan

@NeroBurner @FintasticMan I have fixed it.

ghost avatar Aug 15 '22 14:08 ghost

FYI: you can start/stop a GIF screen recording using I (shift+i)

from https://github.com/InfiniTimeOrg/InfiniSim#run-simulator

I ... start/stop Gif scren capture


please provide screen captures on how it looks on the other watchfaces. I suspect it will look out of place in the PineTimeStyle watchface

NeroBurner avatar Aug 15 '22 14:08 NeroBurner

@NeroBurner for some reason the built in GIF recorder wouldn't capture the red color of the icon. Cycling the Vbat in the simulator looks like this: InfiniSim_2022-08-15_150534

Also note the wonky HRM symbol. Can someone reproduce that behavior of InfiniSim?

ghost avatar Aug 15 '22 15:08 ghost

indeed! something is wrong with my gif-writing-code! :see_no_evil:

colored bat breaking gif

it doesn't happen (or if it happens it is not as visible) on the develop branch

develop gif ok

NeroBurner avatar Aug 15 '22 15:08 NeroBurner

as this issue isn't related to this PR could you please open an issue over at InfiniSim

NeroBurner avatar Aug 15 '22 15:08 NeroBurner

as this issue isn't related to this PR could you please open an issue over at InfiniSim

Sure thing, I just wanted to confirm that this isn't caused by my setup.

ghost avatar Aug 15 '22 16:08 ghost

The battery icon is now colorized when below 15% https://github.com/InfiniTimeOrg/InfiniTime/pull/1503. Colorizing the entire range is not planned.

Riksu9000 avatar Mar 09 '23 15:03 Riksu9000