InfiniTime.git

ref: fdc89f1a20889c0295534f58dc2e82ce8c55a18b

src/displayapp/widgets/StatusIcons.h


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include <lvgl/lvgl.h>

#include "displayapp/screens/Screen.h"
#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
#include "displayapp/screens/BatteryIcon.h"

namespace Pinetime {
  namespace Applications {
    namespace Widgets {
      class StatusIcons {
      public:
        StatusIcons(Controllers::Battery& batteryController, Controllers::Ble& bleController);
        void Align();
        void Create();
        lv_obj_t* GetObject() {
          return container;
        }
        void Update();

      private:
        Screens::BatteryIcon batteryIcon;
        Pinetime::Controllers::Battery& batteryController;
        Controllers::Ble& bleController;

        Screens::DirtyValue<uint8_t> batteryPercentRemaining {};
        Screens::DirtyValue<bool> powerPresent {};
        Screens::DirtyValue<bool> bleState {};
        Screens::DirtyValue<bool> bleRadioEnabled {};

        lv_obj_t* bleIcon;
        lv_obj_t* batteryPlug;
        lv_obj_t* container;
      };
    }
  }
}