diff options
| author | Kieran Cawthray <kieranc@gmail.com> | 2021-11-16 17:10:34 (GMT) |
|---|---|---|
| committer | Kieran Cawthray <kieranc@gmail.com> | 2021-11-16 17:10:34 (GMT) |
| commit | bea5c60a11a9c5b97045093a356988de90bb46da (patch) | |
| tree | 40ac61f401ae6e31d8fbc29f843f75c1a1120247 /src/displayapp/screens/PineTimeStyle.cpp | |
| parent | 29bb359e90bff68bdfca67bbd42baeac73dae6ae (diff) | |
Revert "Fix notification icon alignment"
This reverts commit 29bb359e90bff68bdfca67bbd42baeac73dae6ae.
Diffstat (limited to 'src/displayapp/screens/PineTimeStyle.cpp')
| -rw-r--r-- | src/displayapp/screens/PineTimeStyle.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index a65d259..7c4ed69 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -108,11 +108,11 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, bleIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); - lv_label_set_text(bleIcon, ""); + lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); notificationIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); - lv_label_set_text(notificationIcon, ""); + lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 40); // Calendar icon calendarOuter = lv_obj_create(lv_scr_act(), nullptr); @@ -305,12 +305,12 @@ PineTimeStyle::~PineTimeStyle() { } bool PineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnClose)) { + if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnRandom)) { lv_obj_set_hidden(btnSet, false); savedTick = lv_tick_get(); return true; } - if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && !lv_obj_get_hidden(btnClose)) { + if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && (lv_obj_get_hidden(btnRandom) == false)) { return true; } return false; @@ -359,20 +359,15 @@ void PineTimeStyle::Refresh() { } bleState = bleController.IsConnected(); - if (bleState.Get()) { + if (bleState.IsUpdated()) { lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get())); - } else { - lv_label_set_text(bleIcon, ""); + lv_obj_realign(bleIcon); } notificationState = notificatioManager.AreNewNotificationsAvailable(); - if (notificationState.Get()) { + if (notificationState.IsUpdated()) { lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); - lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25); - lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25); - } else { - lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25); - lv_label_set_text(notificationIcon, ""); + lv_obj_realign(notificationIcon); } currentDateTime = dateTimeController.CurrentDateTime(); |
