More duplicate color dodging
This commit is contained in:
parent
7d1da9f1f9
commit
1c86796eac
1 changed files with 10 additions and 3 deletions
|
@ -419,8 +419,8 @@ void PineTimeStyle::Refresh() {
|
||||||
lv_obj_set_style_local_scale_grad_color(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
lv_obj_set_style_local_scale_grad_color(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lv_obj_is_visible(btnSet) == true) {
|
if (lv_obj_get_hidden(btnSet) == false) {
|
||||||
if ((savedTick > 0) && (lv_tick_get() - savedTick > 5000)) {
|
if ((savedTick > 0) && (lv_tick_get() - savedTick > 3000)) {
|
||||||
lv_obj_set_hidden(btnSet, true);
|
lv_obj_set_hidden(btnSet, true);
|
||||||
savedTick = 0;
|
savedTick = 0;
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,8 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
|
||||||
if (event == LV_EVENT_CLICKED) {
|
if (event == LV_EVENT_CLICKED) {
|
||||||
if (object == btnNextTime) {
|
if (object == btnNextTime) {
|
||||||
valueTime = GetNext(valueTime);
|
valueTime = GetNext(valueTime);
|
||||||
|
if(valueTime == valueBG)
|
||||||
|
valueTime = GetNext(valueTime);
|
||||||
settingsController.SetPTSColorTime(valueTime);
|
settingsController.SetPTSColorTime(valueTime);
|
||||||
lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
||||||
lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
||||||
|
@ -443,6 +444,8 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
|
||||||
}
|
}
|
||||||
if (object == btnPrevTime) {
|
if (object == btnPrevTime) {
|
||||||
valueTime = GetPrevious(valueTime);
|
valueTime = GetPrevious(valueTime);
|
||||||
|
if(valueTime == valueBG)
|
||||||
|
valueTime = GetPrevious(valueTime);
|
||||||
settingsController.SetPTSColorTime(valueTime);
|
settingsController.SetPTSColorTime(valueTime);
|
||||||
lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
||||||
lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
|
||||||
|
@ -464,11 +467,15 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
|
||||||
}
|
}
|
||||||
if (object == btnNextBG) {
|
if (object == btnNextBG) {
|
||||||
valueBG = GetNext(valueBG);
|
valueBG = GetNext(valueBG);
|
||||||
|
if(valueBG == valueTime)
|
||||||
|
valueBG = GetNext(valueBG);
|
||||||
settingsController.SetPTSColorBG(valueBG);
|
settingsController.SetPTSColorBG(valueBG);
|
||||||
lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBG));
|
lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBG));
|
||||||
}
|
}
|
||||||
if (object == btnPrevBG) {
|
if (object == btnPrevBG) {
|
||||||
valueBG = GetPrevious(valueBG);
|
valueBG = GetPrevious(valueBG);
|
||||||
|
if(valueBG == valueTime)
|
||||||
|
valueBG = GetPrevious(valueBG);
|
||||||
settingsController.SetPTSColorBG(valueBG);
|
settingsController.SetPTSColorBG(valueBG);
|
||||||
lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBG));
|
lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBG));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue