Merge pull request #354 from Raupinger/notification-title-fix

Notification title fix
This commit is contained in:
JF002 2021-05-16 11:20:09 +02:00 committed by GitHub
commit b588439719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,7 +176,17 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888)); lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888));
if (title == nullptr) if (title == nullptr)
title = "Notification"; title = "Notification";
char* pchar;
pchar = strchr(title, '\n');
while (pchar != nullptr) {
*pchar = ' ';
pchar =
pchar = strchr(pchar + 1, '\n');
}
lv_label_set_text(alert_type, title); lv_label_set_text(alert_type, title);
lv_label_set_long_mode(alert_type, LV_LABEL_LONG_SROLL_CIRC);
lv_label_set_anim_speed(alert_type, 3);
lv_obj_set_width(alert_type, 180);
lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 16); lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 16);
///////// /////////