diff options
author | JF002 <JF002@users.noreply.github.com> | 2021-05-16 11:20:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-16 11:20:09 +0200 |
commit | b5884397191964a3bc080bd4c6953e2b00a564a9 (patch) | |
tree | 51c9b619149745643759b6c9af422d4df473099d /src/displayapp | |
parent | d7fa000b851024f45e85e0cd0aa688ff088cf957 (diff) | |
parent | 2627ef760e7e42ad0f9a1d2fe6299588b8fb631a (diff) |
Merge pull request #354 from Raupinger/notification-title-fix
Notification title fix
Diffstat (limited to 'src/displayapp')
-rw-r--r-- | src/displayapp/screens/Notifications.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index f0fd2f66..1f113750 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -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)); if (title == nullptr) 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_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); ///////// |