PTS: Fix double tap behaviour on settings screen (#1669)

Fixes #1467 "Double tapping PineTimeStyle steps style button sends watch to sleep"
Double tap is disabled on the color settings screen by checking if the Rnd button is visible, but this didn't work for the options screen as the Rnd button isn't visible. I've changed it to check if the Close button is visible instead, which is used on both settings screens, and resolves the bug. I also changed the button used to disable the long press behaviour which was an as-yet-undiscovered bug which would have allowed the long press action to be used when the options screen was visible.
This commit is contained in:
kieranc 2023-03-04 08:16:10 +01:00 committed by GitHub
parent 08b4cfbb50
commit ada182336f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -364,13 +364,13 @@ WatchFacePineTimeStyle::~WatchFacePineTimeStyle() {
}
bool WatchFacePineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnRandom)) {
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnClose)) {
lv_obj_set_hidden(btnSetColor, false);
lv_obj_set_hidden(btnSetOpts, false);
savedTick = lv_tick_get();
return true;
}
if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && (lv_obj_get_hidden(btnRandom) == false)) {
if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && (lv_obj_get_hidden(btnClose) == false)) {
return true;
}
return false;