Reformatted all the files according to clang-format style
This commit is contained in:
@@ -46,8 +46,16 @@ static void stop_lap_event_handler(lv_obj_t* obj, lv_event_t event) {
|
||||
}
|
||||
|
||||
StopWatch::StopWatch(DisplayApp* app)
|
||||
: Screen(app), running {true}, currentState {States::Init}, currentEvent {Events::Stop}, startTime {}, oldTimeElapsed {},
|
||||
currentTimeSeparated {}, lapBuffer {}, lapNr {}, lapPressed {false} {
|
||||
: Screen(app),
|
||||
running {true},
|
||||
currentState {States::Init},
|
||||
currentEvent {Events::Stop},
|
||||
startTime {},
|
||||
oldTimeElapsed {},
|
||||
currentTimeSeparated {},
|
||||
lapBuffer {},
|
||||
lapNr {},
|
||||
lapPressed {false} {
|
||||
|
||||
time = lv_label_create(lv_scr_act(), nullptr);
|
||||
lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
|
||||
@@ -56,7 +64,7 @@ StopWatch::StopWatch(DisplayApp* app)
|
||||
lv_obj_align(time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -45);
|
||||
|
||||
msecTime = lv_label_create(lv_scr_act(), nullptr);
|
||||
//lv_obj_set_style_local_text_font(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
|
||||
// lv_obj_set_style_local_text_font(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
|
||||
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
|
||||
lv_label_set_text(msecTime, "00");
|
||||
lv_obj_align(msecTime, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 108, 3);
|
||||
@@ -70,13 +78,13 @@ StopWatch::StopWatch(DisplayApp* app)
|
||||
lv_label_set_text(txtPlayPause, Symbols::play);
|
||||
|
||||
lapOneText = lv_label_create(lv_scr_act(), nullptr);
|
||||
//lv_obj_set_style_local_text_font(lapOneText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
|
||||
// lv_obj_set_style_local_text_font(lapOneText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
|
||||
lv_obj_set_style_local_text_color(lapOneText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
|
||||
lv_obj_align(lapOneText, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 50, 30);
|
||||
lv_label_set_text(lapOneText, "");
|
||||
|
||||
lapTwoText = lv_label_create(lv_scr_act(), nullptr);
|
||||
//lv_obj_set_style_local_text_font(lapTwoText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
|
||||
// lv_obj_set_style_local_text_font(lapTwoText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
|
||||
lv_obj_set_style_local_text_color(lapTwoText, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
|
||||
lv_obj_align(lapTwoText, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 50, 55);
|
||||
lv_label_set_text(lapTwoText, "");
|
||||
@@ -145,10 +153,12 @@ bool StopWatch::Refresh() {
|
||||
|
||||
if (lapPressed == true) {
|
||||
if (lapBuffer[1]) {
|
||||
lv_label_set_text_fmt(lapOneText, "#%2d %2d:%02d.%02d", (lapNr - 1), lapBuffer[1]->mins, lapBuffer[1]->secs, lapBuffer[1]->hundredths);
|
||||
lv_label_set_text_fmt(
|
||||
lapOneText, "#%2d %2d:%02d.%02d", (lapNr - 1), lapBuffer[1]->mins, lapBuffer[1]->secs, lapBuffer[1]->hundredths);
|
||||
}
|
||||
if (lapBuffer[0]) {
|
||||
lv_label_set_text_fmt(lapTwoText, "#%2d %2d:%02d.%02d", lapNr, lapBuffer[0]->mins, lapBuffer[0]->secs, lapBuffer[0]->hundredths);
|
||||
lv_label_set_text_fmt(
|
||||
lapTwoText, "#%2d %2d:%02d.%02d", lapNr, lapBuffer[0]->mins, lapBuffer[0]->secs, lapBuffer[0]->hundredths);
|
||||
}
|
||||
// Reset the bool to avoid setting the text in each cycle until there is a change
|
||||
lapPressed = false;
|
||||
|
||||
Reference in New Issue
Block a user