Skip to content

Commit

Permalink
Change gauge needle color when background is white
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranc committed Oct 18, 2021
1 parent 1c3372b commit 994f373
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/displayapp/screens/PineTimeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app,
lv_obj_align(dateMonth, sidebar, LV_ALIGN_CENTER, 0, 32);

// Step count gauge
needle_colors[0] = LV_COLOR_WHITE;
if (settingsController.GetPTSColorBar() == Pinetime::Controllers::Settings::Colors::White) {
needle_colors[0] = LV_COLOR_BLACK;
} else {
needle_colors[0] = LV_COLOR_WHITE;
}
stepGauge = lv_gauge_create(lv_scr_act(), nullptr);
lv_gauge_set_needle_count(stepGauge, 1, needle_colors);
lv_obj_set_size(stepGauge, 40, 40);
Expand Down Expand Up @@ -458,13 +462,23 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
valueBar = GetNext(valueBar);
if(valueBar == Controllers::Settings::Colors::Black)
valueBar = GetNext(valueBar);
if(valueBar == Controllers::Settings::Colors::White) {
needle_colors[0] = LV_COLOR_BLACK;
} else {
needle_colors[0] = LV_COLOR_WHITE;
}
settingsController.SetPTSColorBar(valueBar);
lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBar));
}
if (object == btnPrevBar) {
valueBar = GetPrevious(valueBar);
if(valueBar == Controllers::Settings::Colors::Black)
valueBar = GetPrevious(valueBar);
if(valueBar == Controllers::Settings::Colors::White) {
needle_colors[0] = LV_COLOR_BLACK;
} else {
needle_colors[0] = LV_COLOR_WHITE;
}
settingsController.SetPTSColorBar(valueBar);
lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBar));
}
Expand Down

0 comments on commit 994f373

Please sign in to comment.