diff options
| author | Kieran Cawthray <kieranc@gmail.com> | 2021-10-23 16:12:41 (GMT) |
|---|---|---|
| committer | Kieran Cawthray <kieranc@gmail.com> | 2021-10-23 16:12:41 (GMT) |
| commit | 85d494a987e8edfd51fbb0eb6dfa04ea108cbb48 (patch) | |
| tree | b12d7aa10da078dd01eb2155892af6bb049de0f5 | |
| parent | da97a94a0fc89a646f9a7ab9d1b9937164227d2f (diff) | |
Revert "Update GetNext/GetPrevious"
This reverts commit 411c10ec317464a79c353dc5c18b805cf4bdf7d0.
| -rw-r--r-- | src/displayapp/screens/PineTimeStyle.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index a2b94b5..fa9aec1 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -561,13 +561,22 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) { Pinetime::Controllers::Settings::Colors PineTimeStyle::GetNext(Pinetime::Controllers::Settings::Colors color) { auto colorAsInt = static_cast<uint8_t>(color); Pinetime::Controllers::Settings::Colors nextColor; - nextColor = static_cast<Controllers::Settings::Colors>((colorAsInt + 1) % 17); + if (colorAsInt < 16) { + nextColor = static_cast<Controllers::Settings::Colors>(colorAsInt + 1); + } else { + nextColor = static_cast<Controllers::Settings::Colors>(0); + } return nextColor; } Pinetime::Controllers::Settings::Colors PineTimeStyle::GetPrevious(Pinetime::Controllers::Settings::Colors color) { auto colorAsInt = static_cast<uint8_t>(color); Pinetime::Controllers::Settings::Colors prevColor; - prevColor = static_cast<Controllers::Settings::Colors>((colorAsInt - 1) % 17); + + if (colorAsInt > 0) { + prevColor = static_cast<Controllers::Settings::Colors>(colorAsInt - 1); + } else { + prevColor = static_cast<Controllers::Settings::Colors>(16); + } return prevColor; }
\ No newline at end of file |
