Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a fast mode to Counter where more than one is skipped on long press #2215

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ljahn
Copy link

@ljahn ljahn commented Dec 31, 2024

Oftentimes I cannot be bothered to hold the + button of the timer down until 30s is reached, because it takes so long. Instead, I just set 30s less and wait around a bit after the timer rings.
When setting an alarm, I have the same problem with the minutes. It just takes too long.

This adds a 'fast mode' to the Counter widget that is used in these cases.
An application designer can enable this for a widget and is then able to specify how many steps should be skipped on each trigger of the LV_EVENT_LONG_PRESSED_REPEAT event.

This PR enables this with value 5 for Timer, Alarm (minutes only) and SettingDateTime (days and minutes only).

Also includes a small fix for Counter where the ValueChangedHandler was not called if SetValue was used. I don't think there were any bugs caused by this yet, I checked all uses of the function.

Copy link

Build size and comparison to main:

Section Size Difference
text 372976B 160B
data 948B 0B
bss 22536B 0B

@ljahn
Copy link
Author

ljahn commented Dec 31, 2024

The value of 5 I selected for the fast skip might be too high, maybe 3 would be better.
I will evaluate this in my daily usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant