diff options
author | Kieran Cawthray <kieranc@gmail.com> | 2021-10-20 18:07:08 +0200 |
---|---|---|
committer | Kieran Cawthray <kieranc@gmail.com> | 2021-10-20 18:07:08 +0200 |
commit | 411c10ec317464a79c353dc5c18b805cf4bdf7d0 (patch) | |
tree | 182ea8d60d75c8bc1d72b0d5a020af982c832d9f /src/displayapp/screens | |
parent | 3ed01b33e7303a64615bfc0db2e9d42bb2624bb6 (diff) |
Update GetNext/GetPrevious
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r-- | src/displayapp/screens/PineTimeStyle.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index fa9aec1c..a2b94b5e 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -561,22 +561,13 @@ 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; - if (colorAsInt < 16) { - nextColor = static_cast<Controllers::Settings::Colors>(colorAsInt + 1); - } else { - nextColor = static_cast<Controllers::Settings::Colors>(0); - } + nextColor = static_cast<Controllers::Settings::Colors>((colorAsInt + 1) % 17); 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; - - if (colorAsInt > 0) { - prevColor = static_cast<Controllers::Settings::Colors>(colorAsInt - 1); - } else { - prevColor = static_cast<Controllers::Settings::Colors>(16); - } + prevColor = static_cast<Controllers::Settings::Colors>((colorAsInt - 1) % 17); return prevColor; }
\ No newline at end of file |