WatchfaceAnalog: add ble icon (#1430)
This commit is contained in:
		
							parent
							
								
									f4684f6ea5
								
							
						
					
					
						commit
						56b6291ab7
					
				@ -72,6 +72,10 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
 | 
				
			|||||||
  lv_label_set_text_static(plugIcon, Symbols::plug);
 | 
					  lv_label_set_text_static(plugIcon, Symbols::plug);
 | 
				
			||||||
  lv_obj_align(plugIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
 | 
					  lv_obj_align(plugIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bleIcon = lv_label_create(lv_scr_act(), nullptr);
 | 
				
			||||||
 | 
					  lv_label_set_text_static(bleIcon, "");
 | 
				
			||||||
 | 
					  lv_obj_align(bleIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, -30, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  notificationIcon = lv_label_create(lv_scr_act(), nullptr);
 | 
					  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_LIME);
 | 
					  lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_LIME);
 | 
				
			||||||
  lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));
 | 
					  lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));
 | 
				
			||||||
@ -204,6 +208,15 @@ void WatchFaceAnalog::Refresh() {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bleState = bleController.IsConnected();
 | 
				
			||||||
 | 
					  if (bleState.IsUpdated()) {
 | 
				
			||||||
 | 
					    if (bleState.Get()) {
 | 
				
			||||||
 | 
					      lv_label_set_text_static(bleIcon, Symbols::bluetooth);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      lv_label_set_text_static(bleIcon, "");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  notificationState = notificationManager.AreNewNotificationsAvailable();
 | 
					  notificationState = notificationManager.AreNewNotificationsAvailable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (notificationState.IsUpdated()) {
 | 
					  if (notificationState.IsUpdated()) {
 | 
				
			||||||
 | 
				
			|||||||
@ -44,6 +44,7 @@ namespace Pinetime {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        DirtyValue<uint8_t> batteryPercentRemaining {0};
 | 
					        DirtyValue<uint8_t> batteryPercentRemaining {0};
 | 
				
			||||||
        DirtyValue<bool> isCharging {};
 | 
					        DirtyValue<bool> isCharging {};
 | 
				
			||||||
 | 
					        DirtyValue<bool> bleState {};
 | 
				
			||||||
        DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime;
 | 
					        DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime;
 | 
				
			||||||
        DirtyValue<bool> notificationState {false};
 | 
					        DirtyValue<bool> notificationState {false};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -68,6 +69,7 @@ namespace Pinetime {
 | 
				
			|||||||
        lv_obj_t* label_date_day;
 | 
					        lv_obj_t* label_date_day;
 | 
				
			||||||
        lv_obj_t* plugIcon;
 | 
					        lv_obj_t* plugIcon;
 | 
				
			||||||
        lv_obj_t* notificationIcon;
 | 
					        lv_obj_t* notificationIcon;
 | 
				
			||||||
 | 
					        lv_obj_t* bleIcon;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        BatteryIcon batteryIcon;
 | 
					        BatteryIcon batteryIcon;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user