InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

SettingWakeUp: use Checkboxlist.h

Open NeroBurner opened this issue 1 year ago • 2 comments

Update CheckboxList.h to optionally be able to get checkboxes (instead of the default of radio-buttons) and be able to have multi-selection through a new callback.

Use these updated capabilities of CheckboxList.h to replace the nearly identical code of SettingWakeUp.h

One noticable change is that previously all 5 wake-up-settings were on the same page. But with this PR and the default value of 4 settings per screen on CheckboxList.h we have two pages

Before:

InfiniSim_2024-09-18_203919_wakeup_main

Now: InfiniSim_2024-09-18_203600_wakeup_checkboxlist1 InfiniSim_2024-09-18_203610_wakeup_checkboxlist2

NeroBurner avatar Sep 17 '24 21:09 NeroBurner

Build size and comparison to main:

Section Size Difference
text 374712B 528B
data 948B 0B
bss 63480B 0B

github-actions[bot] avatar Sep 17 '24 22:09 github-actions[bot]

I like the idea and the implementation via the IsChecked function.

I am only reading the code right now, but think we can simplify the interface. If I understand it correctly, the function is provided for checkboxes and the original value is provided for radio buttons? Can we infer the style from that and omit the boolean flag? And maybe make the original value optional, if it is not always needed?

minacode avatar May 12 '25 10:05 minacode