summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Notifications.cpp
diff options
context:
space:
mode:
authorKieran Cawthray <kieranc@gmail.com>2022-09-05 22:03:56 +0200
committerKieran Cawthray <kieranc@gmail.com>2022-09-05 22:03:56 +0200
commit293340515812b15030b6497a3eed1b1b8fceadae (patch)
treea46c96953676a756723477a363a5eedafbbd3dd1 /src/displayapp/screens/Notifications.cpp
parent593ca2028d77c013fa4026a7183b7f66f2cca5ba (diff)
parentf53e75063b6ef618d65a1f287df52ba01c3351f5 (diff)
Merge remote-tracking branch 'upstream/develop' into pts-options
Diffstat (limited to 'src/displayapp/screens/Notifications.cpp')
-rw-r--r--src/displayapp/screens/Notifications.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp
index 1479cf5d..90a010f5 100644
--- a/src/displayapp/screens/Notifications.cpp
+++ b/src/displayapp/screens/Notifications.cpp
@@ -4,6 +4,7 @@
#include "components/ble/AlertNotificationService.h"
#include "displayapp/screens/Symbols.h"
#include <algorithm>
+#include "displayapp/InfiniTimeTheme.h"
using namespace Pinetime::Applications::Screens;
extern lv_font_t jetbrains_mono_extrabold_compressed;
@@ -257,7 +258,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_set_style_local_border_width(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
subject_container = lv_cont_create(container, nullptr);
- lv_obj_set_style_local_bg_color(subject_container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x38, 0x38, 0x38));
+ lv_obj_set_style_local_bg_color(subject_container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, Colors::bgAlt);
lv_obj_set_style_local_pad_all(subject_container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 10);
lv_obj_set_style_local_pad_inner(subject_container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5);
lv_obj_set_style_local_border_width(subject_container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
@@ -272,7 +273,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_align(alert_count, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 16);
lv_obj_t* alert_type = lv_label_create(container, nullptr);
- lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
+ lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::orange);
if (title == nullptr) {
lv_label_set_text_static(alert_type, "Notification");
} else {
@@ -289,21 +290,16 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_set_width(alert_type, 180);
lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 16);
- /////////
+ lv_obj_t* alert_subject = lv_label_create(subject_container, nullptr);
+ lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK);
+ lv_obj_set_width(alert_subject, LV_HOR_RES - 20);
+
switch (category) {
- default: {
- lv_obj_t* alert_subject = lv_label_create(subject_container, nullptr);
- lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xb0, 0x0));
- lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK);
- lv_obj_set_width(alert_subject, LV_HOR_RES - 20);
+ default:
lv_label_set_text(alert_subject, msg);
- } break;
+ break;
case Controllers::NotificationManager::Categories::IncomingCall: {
lv_obj_set_height(subject_container, 108);
- lv_obj_t* alert_subject = lv_label_create(subject_container, nullptr);
- lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xb0, 0x0));
- lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK);
- lv_obj_set_width(alert_subject, LV_HOR_RES - 20);
lv_label_set_text_static(alert_subject, "Incoming call from");
lv_obj_t* alert_caller = lv_label_create(subject_container, nullptr);
@@ -319,7 +315,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_align(bt_accept, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
label_accept = lv_label_create(bt_accept, nullptr);
lv_label_set_text_static(label_accept, Symbols::phone);
- lv_obj_set_style_local_bg_color(bt_accept, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
+ lv_obj_set_style_local_bg_color(bt_accept, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::highlight);
bt_reject = lv_btn_create(container, nullptr);
bt_reject->user_data = this;
@@ -337,7 +333,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_align(bt_mute, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
label_mute = lv_label_create(bt_mute, nullptr);
lv_label_set_text_static(label_mute, Symbols::volumMute);
- lv_obj_set_style_local_bg_color(bt_mute, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
+ lv_obj_set_style_local_bg_color(bt_mute, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
} break;
}
}