Skip to content

Commit e140a88

Browse files
riban-bwvkareh
authored andcommitted
Show blue icon when connected, grey when disconnected and hide when disabled
1 parent 7128fc0 commit e140a88

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/displayapp/widgets/StatusIcons.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ void StatusIcons::Update() {
4848
lv_obj_set_hidden(alarmIcon, !alarmEnabled.Get());
4949
}
5050

51-
bleState = bleController.IsConnected();
5251
bleRadioEnabled = bleController.IsRadioEnabled();
53-
if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) {
54-
lv_obj_set_hidden(bleIcon, !bleState.Get());
52+
if (bleRadioEnabled.IsUpdated()) {
53+
lv_obj_set_hidden(bleIcon, !bleRadioEnabled.Get());
54+
}
55+
56+
bleState = bleController.IsConnected();
57+
if (bleState.IsUpdated()) {
58+
lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, bleState.Get()?LV_COLOR_BLUE:LV_COLOR_GRAY);
5559
}
5660

5761
lv_obj_realign(container);

0 commit comments

Comments
 (0)