Прошло 2 года.
This commit is contained in:
24
src/ui/views/battery_view.h
Normal file
24
src/ui/views/battery_view.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "epdiy.h"
|
||||
|
||||
namespace ui {
|
||||
|
||||
struct BatteryProps {
|
||||
bool valid;
|
||||
int percent;
|
||||
};
|
||||
|
||||
class BatteryView {
|
||||
public:
|
||||
void layout(int screen_width, int screen_height);
|
||||
void render(uint8_t* framebuffer, const BatteryProps& props) const;
|
||||
const EpdRect& bounds() const;
|
||||
|
||||
private:
|
||||
EpdRect bounds_ = {0, 0, 0, 0};
|
||||
int text_x_ = 0;
|
||||
int text_y_ = 0;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
Reference in New Issue
Block a user