Skip to content

Commit b588439

Browse files
authored
Merge pull request #354 from Raupinger/notification-title-fix
Notification title fix
2 parents d7fa000 + 2627ef7 commit b588439

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/displayapp/screens/Notifications.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,17 @@ Notifications::NotificationItem::NotificationItem(const char* title,
176176
lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888));
177177
if (title == nullptr)
178178
title = "Notification";
179+
char* pchar;
180+
pchar = strchr(title, '\n');
181+
while (pchar != nullptr) {
182+
*pchar = ' ';
183+
pchar =
184+
pchar = strchr(pchar + 1, '\n');
185+
}
179186
lv_label_set_text(alert_type, title);
187+
lv_label_set_long_mode(alert_type, LV_LABEL_LONG_SROLL_CIRC);
188+
lv_label_set_anim_speed(alert_type, 3);
189+
lv_obj_set_width(alert_type, 180);
180190
lv_obj_align(alert_type, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 16);
181191

182192
/////////

0 commit comments

Comments
 (0)