Skip to content

Commit bea5c60

Browse files
committed
Revert "Fix notification icon alignment"
This reverts commit 29bb359.
1 parent 29bb359 commit bea5c60

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

src/displayapp/screens/PineTimeStyle.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app,
108108

109109
bleIcon = lv_label_create(lv_scr_act(), nullptr);
110110
lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
111-
lv_label_set_text(bleIcon, "");
111+
lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25);
112112

113113
notificationIcon = lv_label_create(lv_scr_act(), nullptr);
114114
lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
115-
lv_label_set_text(notificationIcon, "");
115+
lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 40);
116116

117117
// Calendar icon
118118
calendarOuter = lv_obj_create(lv_scr_act(), nullptr);
@@ -305,12 +305,12 @@ PineTimeStyle::~PineTimeStyle() {
305305
}
306306

307307
bool PineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
308-
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnClose)) {
308+
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnRandom)) {
309309
lv_obj_set_hidden(btnSet, false);
310310
savedTick = lv_tick_get();
311311
return true;
312312
}
313-
if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && !lv_obj_get_hidden(btnClose)) {
313+
if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && (lv_obj_get_hidden(btnRandom) == false)) {
314314
return true;
315315
}
316316
return false;
@@ -359,20 +359,15 @@ void PineTimeStyle::Refresh() {
359359
}
360360

361361
bleState = bleController.IsConnected();
362-
if (bleState.Get()) {
362+
if (bleState.IsUpdated()) {
363363
lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get()));
364-
} else {
365-
lv_label_set_text(bleIcon, "");
364+
lv_obj_realign(bleIcon);
366365
}
367366

368367
notificationState = notificatioManager.AreNewNotificationsAvailable();
369-
if (notificationState.Get()) {
368+
if (notificationState.IsUpdated()) {
370369
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(notificationState.Get()));
371-
lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25);
372-
lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25);
373-
} else {
374-
lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25);
375-
lv_label_set_text(notificationIcon, "");
370+
lv_obj_realign(notificationIcon);
376371
}
377372

378373
currentDateTime = dateTimeController.CurrentDateTime();

0 commit comments

Comments
 (0)