Skip to content

Commit 85d494a

Browse files
committed
Revert "Update GetNext/GetPrevious"
This reverts commit 411c10e.
1 parent da97a94 commit 85d494a

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/displayapp/screens/PineTimeStyle.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,22 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
561561
Pinetime::Controllers::Settings::Colors PineTimeStyle::GetNext(Pinetime::Controllers::Settings::Colors color) {
562562
auto colorAsInt = static_cast<uint8_t>(color);
563563
Pinetime::Controllers::Settings::Colors nextColor;
564-
nextColor = static_cast<Controllers::Settings::Colors>((colorAsInt + 1) % 17);
564+
if (colorAsInt < 16) {
565+
nextColor = static_cast<Controllers::Settings::Colors>(colorAsInt + 1);
566+
} else {
567+
nextColor = static_cast<Controllers::Settings::Colors>(0);
568+
}
565569
return nextColor;
566570
}
567571

568572
Pinetime::Controllers::Settings::Colors PineTimeStyle::GetPrevious(Pinetime::Controllers::Settings::Colors color) {
569573
auto colorAsInt = static_cast<uint8_t>(color);
570574
Pinetime::Controllers::Settings::Colors prevColor;
571-
prevColor = static_cast<Controllers::Settings::Colors>((colorAsInt - 1) % 17);
575+
576+
if (colorAsInt > 0) {
577+
prevColor = static_cast<Controllers::Settings::Colors>(colorAsInt - 1);
578+
} else {
579+
prevColor = static_cast<Controllers::Settings::Colors>(16);
580+
}
572581
return prevColor;
573582
}

0 commit comments

Comments
 (0)