Centralize most color definitions (#1258)
This commit is contained in:
@@ -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;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include "displayapp/widgets/PageIndicator.h"
|
||||
#include "displayapp/InfiniTimeTheme.h"
|
||||
|
||||
using namespace Pinetime::Applications::Widgets;
|
||||
|
||||
@@ -13,7 +14,7 @@ void PageIndicator::Create() {
|
||||
|
||||
pageIndicatorBase = lv_line_create(lv_scr_act(), nullptr);
|
||||
lv_obj_set_style_local_line_width(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_local_line_color(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
|
||||
lv_obj_set_style_local_line_color(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::bgDark);
|
||||
lv_line_set_points(pageIndicatorBase, pageIndicatorBasePoints, 2);
|
||||
|
||||
const int16_t indicatorSize = LV_VER_RES / nScreens;
|
||||
@@ -26,6 +27,6 @@ void PageIndicator::Create() {
|
||||
|
||||
pageIndicator = lv_line_create(lv_scr_act(), nullptr);
|
||||
lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
|
||||
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
|
||||
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
|
||||
lv_line_set_points(pageIndicator, pageIndicatorPoints, 2);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ void StatusIcons::Create() {
|
||||
lv_label_set_text_static(bleIcon, Screens::Symbols::bluetooth);
|
||||
|
||||
batteryPlug = lv_label_create(container, nullptr);
|
||||
lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFF0000));
|
||||
lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED);
|
||||
lv_label_set_text_static(batteryPlug, Screens::Symbols::plug);
|
||||
|
||||
batteryIcon.Create(container);
|
||||
|
Reference in New Issue
Block a user