2020-03-15 18:03:11 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <libs/lvgl/src/lv_core/lv_obj.h>
|
2020-10-02 21:16:48 +02:00
|
|
|
#include "components/brightness/BrightnessController.h"
|
2020-03-15 18:03:11 +01:00
|
|
|
#include "Screen.h"
|
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
class Brightness : public Screen {
|
|
|
|
public:
|
|
|
|
Brightness(DisplayApp* app, Controllers::BrightnessController& brightness);
|
|
|
|
~Brightness() override;
|
|
|
|
bool Refresh() override;
|
|
|
|
bool OnButtonPushed() override;
|
2020-03-15 21:01:24 +01:00
|
|
|
bool OnTouchEvent(TouchEvents event) override;
|
2020-03-15 18:03:11 +01:00
|
|
|
|
|
|
|
void OnValueChanged();
|
|
|
|
private:
|
|
|
|
bool running = true;
|
|
|
|
Controllers::BrightnessController& brightness;
|
|
|
|
|
|
|
|
lv_obj_t * slider_label;
|
|
|
|
lv_obj_t * slider;
|
|
|
|
|
|
|
|
const char* LevelToString(Controllers::BrightnessController::Levels level);
|
|
|
|
uint8_t LevelToInt(Controllers::BrightnessController::Levels level);
|
|
|
|
void SetValue(uint8_t value);
|
2020-03-15 21:01:24 +01:00
|
|
|
void SetValue();
|
2020-03-15 18:03:11 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|