diff options
author | Diego Miguel <dmlls@diegomiguel.me> | 2022-06-11 15:46:16 +0200 |
---|---|---|
committer | Diego Miguel <dmlls@diegomiguel.me> | 2022-06-11 16:57:24 +0200 |
commit | 18cff286c75f432095db4b188e0f9a8a9e2bd8e8 (patch) | |
tree | bc71c4b3077447eca67b1ecbcd85245c8c649d3e /src | |
parent | 2ad51e6a98004f0f163c10231821ad4b2da70163 (diff) |
Make notification color white when side cover off
Diffstat (limited to 'src')
-rw-r--r-- | src/displayapp/screens/WatchFaceInfineat.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp index bd62c1b3..cdb7cdbd 100644 --- a/src/displayapp/screens/WatchFaceInfineat.cpp +++ b/src/displayapp/screens/WatchFaceInfineat.cpp @@ -152,6 +152,13 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app, lv_line_set_points(lineBattery, lineBatteryPoints, 2); lv_obj_move_foreground(lineBattery); + notificationIcon = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_style_local_bg_color(notificationIcon, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, + lv_color_hex(infineatColors.orange[settingsController.GetInfineatColorIndex()*nLines + 7])); + lv_obj_set_style_local_radius(notificationIcon, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE); + lv_obj_set_size(notificationIcon, 13, 13); + lv_obj_set_hidden(notificationIcon, true); + if(!settingsController.GetInfineatShowSideCover()) { ToggleBatteryIndicatorColor(false); lv_obj_set_hidden(line0, true); @@ -165,13 +172,6 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app, lv_obj_set_hidden(line8, true); } - notificationIcon = lv_obj_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_bg_color(notificationIcon, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, - lv_color_hex(infineatColors.orange[settingsController.GetInfineatColorIndex()*nLines + 7])); - lv_obj_set_style_local_radius(notificationIcon, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE); - lv_obj_set_size(notificationIcon, 13, 13); - lv_obj_set_hidden(notificationIcon, true); - timeContainer = lv_obj_create(lv_scr_act(), nullptr); lv_obj_set_style_local_bg_opa(timeContainer, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP); lv_obj_set_size(timeContainer, 110, 145); @@ -518,13 +518,16 @@ void WatchFaceInfineat::SetBatteryLevel(uint8_t batteryPercent) { } void WatchFaceInfineat::ToggleBatteryIndicatorColor(bool showSideCover) { - if (!showSideCover) { // make indicator white + if (!showSideCover) { // make indicator and notification icon color white lv_obj_set_style_local_image_recolor_opa(logoPine, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_100); lv_obj_set_style_local_image_recolor(logoPine, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); lv_obj_set_style_local_line_color(lineBattery, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_set_style_local_bg_color(notificationIcon, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); } else { lv_obj_set_style_local_image_recolor_opa(logoPine, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_0); lv_obj_set_style_local_line_color(lineBattery, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(infineatColors.orange[settingsController.GetInfineatColorIndex()*nLines + 4])); + lv_obj_set_style_local_bg_color(notificationIcon, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, + lv_color_hex(infineatColors.orange[settingsController.GetInfineatColorIndex()*nLines + 7])); } } |