diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2022-08-16 08:21:23 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-16 08:21:23 +0300 |
| commit | 78fc1682dac113fb6583d29de4a5f440c2e42363 (patch) | |
| tree | a64e1bb2ba0f240fcec5a487a7d0fe1c55c24e74 /src/displayapp/widgets/Counter.cpp | |
| parent | d6aa767bdac84ac7ed8469288ae3400b5c0b5698 (diff) | |
Centralize most color definitions (#1258)
Diffstat (limited to 'src/displayapp/widgets/Counter.cpp')
| -rw-r--r-- | src/displayapp/widgets/Counter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/displayapp/widgets/Counter.cpp b/src/displayapp/widgets/Counter.cpp index d8a1626e..3c50a105 100644 --- a/src/displayapp/widgets/Counter.cpp +++ b/src/displayapp/widgets/Counter.cpp @@ -1,5 +1,6 @@ #include "displayapp/widgets/Counter.h" #include "components/datetime/DateTimeController.h" +#include "displayapp/InfiniTimeTheme.h" using namespace Pinetime::Applications::Widgets; @@ -108,10 +109,8 @@ void Counter::SetValueChangedEventCallback(void* userData, void (*handler)(void* } void Counter::Create() { - constexpr lv_color_t bgColor = LV_COLOR_MAKE(0x38, 0x38, 0x38); - counterContainer = lv_obj_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_bg_color(counterContainer, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, bgColor); + lv_obj_set_style_local_bg_color(counterContainer, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::bgAlt); number = lv_label_create(counterContainer, nullptr); lv_obj_set_style_local_text_font(number, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &font); @@ -133,7 +132,7 @@ void Counter::Create() { UpdateLabel(); upBtn = lv_btn_create(counterContainer, nullptr); - lv_obj_set_style_local_bg_color(upBtn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, bgColor); + lv_obj_set_style_local_bg_color(upBtn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::bgAlt); lv_obj_set_size(upBtn, width, btnHeight); lv_obj_align(upBtn, nullptr, LV_ALIGN_IN_TOP_MID, 0, 0); upBtn->user_data = this; @@ -145,7 +144,7 @@ void Counter::Create() { lv_obj_align(upLabel, nullptr, LV_ALIGN_CENTER, 0, 0); downBtn = lv_btn_create(counterContainer, nullptr); - lv_obj_set_style_local_bg_color(downBtn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, bgColor); + lv_obj_set_style_local_bg_color(downBtn, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::bgAlt); lv_obj_set_size(downBtn, width, btnHeight); lv_obj_align(downBtn, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, 0); downBtn->user_data = this; |
