Reset timer by long pressing on the button (#1214)
* Reset timer by long pressing on the button * Consider press_lost as released Otherwise the bar would keep increasing if the finger slid off the button
This commit is contained in:
@@ -5,29 +5,42 @@
|
||||
#include "systemtask/SystemTask.h"
|
||||
#include "displayapp/LittleVgl.h"
|
||||
#include "displayapp/widgets/Counter.h"
|
||||
#include <lvgl/lvgl.h>
|
||||
|
||||
#include "components/timer/TimerController.h"
|
||||
|
||||
namespace Pinetime::Applications::Screens {
|
||||
class Timer : public Screen {
|
||||
public:
|
||||
enum class Modes { Normal, Done };
|
||||
|
||||
Timer(DisplayApp* app, Controllers::TimerController& timerController);
|
||||
~Timer() override;
|
||||
void Refresh() override;
|
||||
void SetDone();
|
||||
void OnButtonEvent(lv_obj_t* obj, lv_event_t event);
|
||||
void Reset();
|
||||
void ToggleRunning();
|
||||
void ButtonPressed();
|
||||
void MaskReset();
|
||||
|
||||
private:
|
||||
void SetTimerRunning();
|
||||
void SetTimerStopped();
|
||||
void UpdateMask();
|
||||
Controllers::TimerController& timerController;
|
||||
|
||||
lv_obj_t* msecTime;
|
||||
lv_obj_t* btnPlayPause;
|
||||
lv_obj_t* txtPlayPause;
|
||||
|
||||
lv_obj_t* btnObjectMask;
|
||||
lv_obj_t* highlightObjectMask;
|
||||
lv_objmask_mask_t* btnMask;
|
||||
lv_objmask_mask_t* highlightMask;
|
||||
|
||||
lv_task_t* taskRefresh;
|
||||
Widgets::Counter minuteCounter = Widgets::Counter(0, 59, jetbrains_mono_76);
|
||||
Widgets::Counter secondCounter = Widgets::Counter(0, 59, jetbrains_mono_76);
|
||||
|
||||
bool buttonPressing = false;
|
||||
int maskPosition = 0;
|
||||
TickType_t pressTime;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user