Skip to content

Commit

Permalink
More duplicate color dodging
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranc committed Oct 18, 2021
1 parent 7d1da9f commit 1c86796
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/displayapp/screens/PineTimeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
if (lv_obj_is_visible(btnSet) == true) {
if ((savedTick > 0) && (lv_tick_get() - savedTick > 5000)) {
if (lv_obj_get_hidden(btnSet) == false) {
if ((savedTick > 0) && (lv_tick_get() - savedTick > 3000)) {
lv_obj_set_hidden(btnSet, true);
savedTick = 0;
}
Expand All @@ -435,14 +435,17 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
if (event == LV_EVENT_CLICKED) {
if (object == btnNextTime) {
valueTime = GetNext(valueTime);

if(valueTime == valueBG)
valueTime = GetNext(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(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
lv_obj_set_style_local_text_color(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
}
if (object == btnPrevTime) {
valueTime = GetPrevious(valueTime);
if(valueTime == valueBG)
valueTime = GetPrevious(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(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(valueTime));
Expand All @@ -464,11 +467,15 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
}
if (object == btnNextBG) {
valueBG = GetNext(valueBG);
if(valueBG == valueTime)
valueBG = GetNext(valueBG);
settingsController.SetPTSColorBG(valueBG);
lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBG));
}
if (object == btnPrevBG) {
valueBG = GetPrevious(valueBG);
if(valueBG == valueTime)
valueBG = GetPrevious(valueBG);
settingsController.SetPTSColorBG(valueBG);
lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBG));
}
Expand Down

0 comments on commit 1c86796

Please sign in to comment.