summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/settings
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens/settings')
-rw-r--r--src/displayapp/screens/settings/QuickSettings.cpp71
-rw-r--r--src/displayapp/screens/settings/QuickSettings.h4
-rw-r--r--src/displayapp/screens/settings/SettingDisplay.cpp8
-rw-r--r--src/displayapp/screens/settings/SettingDisplay.h1
-rw-r--r--src/displayapp/screens/settings/SettingPineTimeStyle.cpp318
-rw-r--r--src/displayapp/screens/settings/SettingPineTimeStyle.h56
-rw-r--r--src/displayapp/screens/settings/SettingSetDate.cpp5
-rw-r--r--src/displayapp/screens/settings/SettingSetDate.h1
-rw-r--r--src/displayapp/screens/settings/SettingSetTime.cpp5
-rw-r--r--src/displayapp/screens/settings/SettingSetTime.h1
-rw-r--r--src/displayapp/screens/settings/SettingSteps.cpp7
-rw-r--r--src/displayapp/screens/settings/SettingSteps.h23
-rw-r--r--src/displayapp/screens/settings/SettingTimeFormat.cpp6
-rw-r--r--src/displayapp/screens/settings/SettingTimeFormat.h1
-rw-r--r--src/displayapp/screens/settings/SettingWakeUp.cpp4
-rw-r--r--src/displayapp/screens/settings/SettingWakeUp.h1
-rw-r--r--src/displayapp/screens/settings/SettingWatchFace.cpp4
-rw-r--r--src/displayapp/screens/settings/SettingWatchFace.h1
-rw-r--r--src/displayapp/screens/settings/Settings.cpp11
-rw-r--r--src/displayapp/screens/settings/Settings.h2
20 files changed, 428 insertions, 102 deletions
diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp
index 2cd24876..691c40c8 100644
--- a/src/displayapp/screens/settings/QuickSettings.cpp
+++ b/src/displayapp/screens/settings/QuickSettings.cpp
@@ -30,27 +30,35 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
motorController {motorController},
settingsController {settingsController} {
+ // This is the distance (padding) between all objects on this screen.
+ static constexpr uint8_t innerDistance = 10;
+
// Time
label_time = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes());
lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER);
- lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 15, 4);
+ lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 0, 0);
batteryIcon = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining()));
- lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, -15, 4);
+ lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
- lv_obj_t* lbl_btn;
+ static constexpr uint8_t barHeight = 20 + innerDistance;
+ static constexpr uint8_t buttonHeight = (LV_VER_RES_MAX - barHeight - innerDistance) / 2;
+ static constexpr uint8_t buttonWidth = (LV_HOR_RES_MAX - innerDistance) / 2; // wide buttons
+ //static constexpr uint8_t buttonWidth = buttonHeight; // square buttons
+ static constexpr uint8_t buttonXOffset = (LV_HOR_RES_MAX - buttonWidth * 2 - innerDistance) / 2;
+
+ lv_style_init(&btn_style);
+ lv_style_set_radius(&btn_style, LV_STATE_DEFAULT, buttonHeight / 4);
+ lv_style_set_bg_color(&btn_style, LV_STATE_DEFAULT, lv_color_hex(0x111111));
btn1 = lv_btn_create(lv_scr_act(), nullptr);
btn1->user_data = this;
lv_obj_set_event_cb(btn1, ButtonEventHandler);
- lv_obj_align(btn1, nullptr, LV_ALIGN_CENTER, -50, -30);
- lv_obj_set_style_local_radius(btn1, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
- lv_obj_set_style_local_bg_color(btn1, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
- lv_obj_set_style_local_bg_grad_dir(btn1, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_GRAD_DIR_NONE);
-
- lv_btn_set_fit2(btn1, LV_FIT_TIGHT, LV_FIT_TIGHT);
+ lv_obj_add_style(btn1, LV_BTN_PART_MAIN, &btn_style);
+ lv_obj_set_size(btn1, buttonWidth, buttonHeight);
+ lv_obj_align(btn1, nullptr, LV_ALIGN_IN_TOP_LEFT, buttonXOffset, barHeight);
btn1_lvl = lv_label_create(btn1, nullptr);
lv_obj_set_style_local_text_font(btn1_lvl, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
@@ -59,12 +67,11 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
btn2 = lv_btn_create(lv_scr_act(), nullptr);
btn2->user_data = this;
lv_obj_set_event_cb(btn2, ButtonEventHandler);
- lv_obj_align(btn2, nullptr, LV_ALIGN_CENTER, 50, -30);
- lv_obj_set_style_local_radius(btn2, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
- lv_obj_set_style_local_bg_color(btn2, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
- lv_obj_set_style_local_bg_grad_dir(btn2, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_GRAD_DIR_NONE);
- lv_btn_set_fit2(btn2, LV_FIT_TIGHT, LV_FIT_TIGHT);
+ lv_obj_add_style(btn2, LV_BTN_PART_MAIN, &btn_style);
+ lv_obj_set_size(btn2, buttonWidth, buttonHeight);
+ lv_obj_align(btn2, nullptr, LV_ALIGN_IN_TOP_RIGHT, - buttonXOffset, barHeight);
+ lv_obj_t* lbl_btn;
lbl_btn = lv_label_create(btn2, nullptr);
lv_obj_set_style_local_text_font(lbl_btn, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
lv_label_set_text_static(lbl_btn, Symbols::highlight);
@@ -72,19 +79,16 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
btn3 = lv_btn_create(lv_scr_act(), nullptr);
btn3->user_data = this;
lv_obj_set_event_cb(btn3, ButtonEventHandler);
- lv_obj_align(btn3, nullptr, LV_ALIGN_CENTER, -50, 60);
lv_btn_set_checkable(btn3, true);
- lv_obj_set_style_local_radius(btn3, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
- lv_obj_set_style_local_bg_color(btn3, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
- lv_obj_set_style_local_bg_grad_dir(btn3, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_GRAD_DIR_NONE);
+ lv_obj_add_style(btn3, LV_BTN_PART_MAIN, &btn_style);
lv_obj_set_style_local_bg_color(btn3, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_COLOR_GREEN);
- lv_obj_set_style_local_bg_grad_dir(btn1, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_GRAD_DIR_NONE);
- lv_btn_set_fit2(btn3, LV_FIT_TIGHT, LV_FIT_TIGHT);
+ lv_obj_set_size(btn3, buttonWidth, buttonHeight);
+ lv_obj_align(btn3, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, buttonXOffset, 0);
btn3_lvl = lv_label_create(btn3, nullptr);
lv_obj_set_style_local_text_font(btn3_lvl, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
- if (settingsController.GetVibrationStatus() == Controllers::Settings::Vibration::ON) {
+ if (settingsController.GetNotificationStatus() == Controllers::Settings::Notification::ON) {
lv_obj_add_state(btn3, LV_STATE_CHECKED);
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOn);
} else {
@@ -94,11 +98,9 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
btn4 = lv_btn_create(lv_scr_act(), nullptr);
btn4->user_data = this;
lv_obj_set_event_cb(btn4, ButtonEventHandler);
- lv_obj_align(btn4, nullptr, LV_ALIGN_CENTER, 50, 60);
- lv_obj_set_style_local_radius(btn4, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
- lv_obj_set_style_local_bg_color(btn4, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
- lv_obj_set_style_local_bg_grad_dir(btn4, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_GRAD_DIR_NONE);
- lv_btn_set_fit2(btn4, LV_FIT_TIGHT, LV_FIT_TIGHT);
+ lv_obj_add_style(btn4, LV_BTN_PART_MAIN, &btn_style);
+ lv_obj_set_size(btn4, buttonWidth, buttonHeight);
+ lv_obj_align(btn4, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, - buttonXOffset, 0);
lbl_btn = lv_label_create(btn4, nullptr);
lv_obj_set_style_local_text_font(lbl_btn, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
@@ -114,6 +116,7 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
}
QuickSettings::~QuickSettings() {
+ lv_style_reset(&btn_style);
lv_task_del(taskUpdate);
lv_obj_clean(lv_scr_act());
settingsController.SaveSettings();
@@ -125,12 +128,12 @@ void QuickSettings::UpdateScreen() {
}
void QuickSettings::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
- if (object == btn2 && event == LV_EVENT_PRESSED) {
+ if (object == btn2 && event == LV_EVENT_CLICKED) {
running = false;
app->StartApp(Apps::FlashLight, DisplayApp::FullRefreshDirections::None);
- } else if (object == btn1 && event == LV_EVENT_PRESSED) {
+ } else if (object == btn1 && event == LV_EVENT_CLICKED) {
brightness.Step();
lv_label_set_text_static(btn1_lvl, brightness.GetIcon());
@@ -139,21 +142,17 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object, lv_event_t event) {
} else if (object == btn3 && event == LV_EVENT_VALUE_CHANGED) {
if (lv_obj_get_state(btn3, LV_BTN_PART_MAIN) & LV_STATE_CHECKED) {
- settingsController.SetVibrationStatus(Controllers::Settings::Vibration::ON);
- motorController.SetDuration(35);
+ settingsController.SetNotificationStatus(Controllers::Settings::Notification::ON);
+ motorController.RunForDuration(35);
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOn);
} else {
- settingsController.SetVibrationStatus(Controllers::Settings::Vibration::OFF);
+ settingsController.SetNotificationStatus(Controllers::Settings::Notification::OFF);
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOff);
}
- } else if (object == btn4 && event == LV_EVENT_PRESSED) {
+ } else if (object == btn4 && event == LV_EVENT_CLICKED) {
running = false;
settingsController.SetSettingsMenu(0);
app->StartApp(Apps::Settings, DisplayApp::FullRefreshDirections::Up);
}
}
-
-bool QuickSettings::Refresh() {
- return running;
-}
diff --git a/src/displayapp/screens/settings/QuickSettings.h b/src/displayapp/screens/settings/QuickSettings.h
index e0fc0a87..c036fa5c 100644
--- a/src/displayapp/screens/settings/QuickSettings.h
+++ b/src/displayapp/screens/settings/QuickSettings.h
@@ -27,8 +27,6 @@ namespace Pinetime {
~QuickSettings() override;
- bool Refresh() override;
-
void OnButtonEvent(lv_obj_t* object, lv_event_t event);
void UpdateScreen();
@@ -44,6 +42,8 @@ namespace Pinetime {
lv_obj_t* batteryIcon;
lv_obj_t* label_time;
+ lv_style_t btn_style;
+
lv_obj_t* btn1;
lv_obj_t* btn1_lvl;
lv_obj_t* btn2;
diff --git a/src/displayapp/screens/settings/SettingDisplay.cpp b/src/displayapp/screens/settings/SettingDisplay.cpp
index 4954185d..d8d6c767 100644
--- a/src/displayapp/screens/settings/SettingDisplay.cpp
+++ b/src/displayapp/screens/settings/SettingDisplay.cpp
@@ -80,12 +80,8 @@ SettingDisplay::~SettingDisplay() {
settingsController.SaveSettings();
}
-bool SettingDisplay::Refresh() {
- return running;
-}
-
void SettingDisplay::UpdateSelected(lv_obj_t* object, lv_event_t event) {
- if (event == LV_EVENT_VALUE_CHANGED) {
+ if (event == LV_EVENT_CLICKED) {
for (int i = 0; i < optionsTotal; i++) {
if (object == cbOption[i]) {
lv_checkbox_set_checked(cbOption[i], true);
@@ -110,4 +106,4 @@ void SettingDisplay::UpdateSelected(lv_obj_t* object, lv_event_t event) {
}
}
}
-} \ No newline at end of file
+}
diff --git a/src/displayapp/screens/settings/SettingDisplay.h b/src/displayapp/screens/settings/SettingDisplay.h
index b8ed87ec..51b23aca 100644
--- a/src/displayapp/screens/settings/SettingDisplay.h
+++ b/src/displayapp/screens/settings/SettingDisplay.h
@@ -15,7 +15,6 @@ namespace Pinetime {
SettingDisplay(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
~SettingDisplay() override;
- bool Refresh() override;
void UpdateSelected(lv_obj_t* object, lv_event_t event);
private:
diff --git a/src/displayapp/screens/settings/SettingPineTimeStyle.cpp b/src/displayapp/screens/settings/SettingPineTimeStyle.cpp
new file mode 100644
index 00000000..c9af19b6
--- /dev/null
+++ b/src/displayapp/screens/settings/SettingPineTimeStyle.cpp
@@ -0,0 +1,318 @@
+#include "SettingPineTimeStyle.h"
+#include <lvgl/lvgl.h>
+#include <displayapp/Colors.h>
+#include "displayapp/DisplayApp.h"
+#include "displayapp/screens/Symbols.h"
+
+using namespace Pinetime::Applications::Screens;
+
+namespace {
+ static void event_handler(lv_obj_t* obj, lv_event_t event) {
+ SettingPineTimeStyle* screen = static_cast<SettingPineTimeStyle*>(obj->user_data);
+ screen->UpdateSelected(obj, event);
+ }
+}
+
+SettingPineTimeStyle::SettingPineTimeStyle(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
+ : Screen(app), settingsController {settingsController} {
+ timebar = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorBG()));
+ lv_obj_set_style_local_radius(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(timebar, 200, 240);
+ lv_obj_align(timebar, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 5, 0);
+
+ // Display the time
+
+ timeDD1 = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_font(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &open_sans_light);
+ lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime()));
+ lv_label_set_text(timeDD1, "12");
+ lv_obj_align(timeDD1, timebar, LV_ALIGN_IN_TOP_MID, 5, 5);
+
+ timeDD2 = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_font(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &open_sans_light);
+ lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime()));
+ lv_label_set_text(timeDD2, "34");
+ lv_obj_align(timeDD2, timebar, LV_ALIGN_IN_BOTTOM_MID, 5, -5);
+
+ timeAMPM = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_color(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime()));
+ lv_obj_set_style_local_text_line_space(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, -3);
+ lv_label_set_text(timeAMPM, "A\nM");
+ lv_obj_align(timeAMPM, timebar, LV_ALIGN_IN_BOTTOM_LEFT, 2, -20);
+
+ // Create a 40px wide bar down the right side of the screen
+
+ sidebar = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorBar()));
+ lv_obj_set_style_local_radius(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(sidebar, 40, 240);
+ lv_obj_align(sidebar, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0);
+
+ // Display icons
+
+ batteryIcon = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_label_set_text(batteryIcon, Symbols::batteryFull);
+ lv_obj_align(batteryIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 2);
+
+ bleIcon = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_label_set_text(bleIcon, Symbols::bluetooth);
+ lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25);
+
+ // Calendar icon
+
+ calendarOuter = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(calendarOuter, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_obj_set_style_local_radius(calendarOuter, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(calendarOuter, 34, 34);
+ lv_obj_align(calendarOuter, sidebar, LV_ALIGN_CENTER, 0, 0);
+
+ calendarInner = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(calendarInner, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xffffff));
+ lv_obj_set_style_local_radius(calendarInner, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(calendarInner, 27, 27);
+ lv_obj_align(calendarInner, calendarOuter, LV_ALIGN_CENTER, 0, 0);
+
+ calendarBar1 = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(calendarBar1, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_obj_set_style_local_radius(calendarBar1, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(calendarBar1, 3, 12);
+ lv_obj_align(calendarBar1, calendarOuter, LV_ALIGN_IN_TOP_MID, -6, -3);
+
+ calendarBar2 = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(calendarBar2, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_obj_set_style_local_radius(calendarBar2, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(calendarBar2, 3, 12);
+ lv_obj_align(calendarBar2, calendarOuter, LV_ALIGN_IN_TOP_MID, 6, -3);
+
+ calendarCrossBar1 = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(calendarCrossBar1, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_obj_set_style_local_radius(calendarCrossBar1, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(calendarCrossBar1, 8, 3);
+ lv_obj_align(calendarCrossBar1, calendarBar1, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
+
+ calendarCrossBar2 = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_color(calendarCrossBar2, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_obj_set_style_local_radius(calendarCrossBar2, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
+ lv_obj_set_size(calendarCrossBar2, 8, 3);
+ lv_obj_align(calendarCrossBar2, calendarBar2, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
+
+ // Display date
+
+ dateDayOfWeek = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_color(dateDayOfWeek, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_label_set_text(dateDayOfWeek, "THU");
+ lv_obj_align(dateDayOfWeek, sidebar, LV_ALIGN_CENTER, 0, -34);
+
+ dateDay = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_color(dateDay, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_label_set_text(dateDay, "25");
+ lv_obj_align(dateDay, sidebar, LV_ALIGN_CENTER, 0, 3);
+
+ dateMonth = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_color(dateMonth, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x000000));
+ lv_label_set_text(dateMonth, "MAR");
+ lv_obj_align(dateMonth, sidebar, LV_ALIGN_CENTER, 0, 32);
+
+ // Step count gauge
+ 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);
+ lv_obj_align(stepGauge, sidebar, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
+ lv_gauge_set_scale(stepGauge, 360, 11, 0);
+ lv_gauge_set_angle_offset(stepGauge, 180);
+ lv_gauge_set_critical_value(stepGauge, (100));
+ lv_gauge_set_range(stepGauge, 0, (100));
+ lv_gauge_set_value(stepGauge, 0, 0);
+
+ lv_obj_set_style_local_pad_right(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, 3);
+ lv_obj_set_style_local_pad_left(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, 3);
+ lv_obj_set_style_local_pad_bottom(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, 3);
+ lv_obj_set_style_local_line_opa(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_COVER);
+ lv_obj_set_style_local_scale_width(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, 4);
+ lv_obj_set_style_local_line_width(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, 4);
+ lv_obj_set_style_local_line_color(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
+ lv_obj_set_style_local_line_opa(stepGauge, LV_GAUGE_PART_NEEDLE, LV_STATE_DEFAULT, LV_OPA_COVER);
+ lv_obj_set_style_local_line_width(stepGauge, LV_GAUGE_PART_NEEDLE, LV_STATE_DEFAULT, 3);
+ lv_obj_set_style_local_pad_inner(stepGauge, LV_GAUGE_PART_NEEDLE, LV_STATE_DEFAULT, 4);
+
+ backgroundLabel = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_click(backgroundLabel, true);
+ lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP);
+ lv_obj_set_size(backgroundLabel, 240, 240);
+ lv_obj_set_pos(backgroundLabel, 0, 0);
+ lv_label_set_text(backgroundLabel, "");
+
+ btnNextTime = lv_btn_create(lv_scr_act(), nullptr);
+ btnNextTime->user_data = this;
+ lv_obj_set_size(btnNextTime, 60, 60);
+ lv_obj_align(btnNextTime, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -15, -80);
+ lv_obj_set_style_local_bg_opa(btnNextTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnNextTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, ">");
+ lv_obj_set_event_cb(btnNextTime, event_handler);
+
+ btnPrevTime = lv_btn_create(lv_scr_act(), nullptr);
+ btnPrevTime->user_data = this;
+ lv_obj_set_size(btnPrevTime, 60, 60);
+ lv_obj_align(btnPrevTime, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 15, -80);
+ lv_obj_set_style_local_bg_opa(btnPrevTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnPrevTime, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "<");
+ lv_obj_set_event_cb(btnPrevTime, event_handler);
+
+ btnNextBar = lv_btn_create(lv_scr_act(), nullptr);
+ btnNextBar->user_data = this;
+ lv_obj_set_size(btnNextBar, 60, 60);
+ lv_obj_align(btnNextBar, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -15, 0);
+ lv_obj_set_style_local_bg_opa(btnNextBar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnNextBar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, ">");
+ lv_obj_set_event_cb(btnNextBar, event_handler);
+
+ btnPrevBar = lv_btn_create(lv_scr_act(), nullptr);
+ btnPrevBar->user_data = this;
+ lv_obj_set_size(btnPrevBar, 60, 60);
+ lv_obj_align(btnPrevBar, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 15, 0);
+ lv_obj_set_style_local_bg_opa(btnPrevBar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnPrevBar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "<");
+ lv_obj_set_event_cb(btnPrevBar, event_handler);
+
+ btnNextBG = lv_btn_create(lv_scr_act(), nullptr);
+ btnNextBG->user_data = this;
+ lv_obj_set_size(btnNextBG, 60, 60);
+ lv_obj_align(btnNextBG, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -15, 80);
+ lv_obj_set_style_local_bg_opa(btnNextBG, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnNextBG, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, ">");
+ lv_obj_set_event_cb(btnNextBG, event_handler);
+
+ btnPrevBG = lv_btn_create(lv_scr_act(), nullptr);
+ btnPrevBG->user_data = this;
+ lv_obj_set_size(btnPrevBG, 60, 60);
+ lv_obj_align(btnPrevBG, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 15, 80);
+ lv_obj_set_style_local_bg_opa(btnPrevBG, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnPrevBG, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "<");
+ lv_obj_set_event_cb(btnPrevBG, event_handler);
+
+ btnReset = lv_btn_create(lv_scr_act(), nullptr);
+ btnReset->user_data = this;
+ lv_obj_set_size(btnReset, 60, 60);
+ lv_obj_align(btnReset, lv_scr_act(), LV_ALIGN_CENTER, 0, 80);
+ lv_obj_set_style_local_bg_opa(btnReset, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnReset, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "Rst");
+ lv_obj_set_event_cb(btnReset, event_handler);
+
+ btnRandom = lv_btn_create(lv_scr_act(), nullptr);
+ btnRandom->user_data = this;
+ lv_obj_set_size(btnRandom, 60, 60);
+ lv_obj_align(btnRandom, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
+ lv_obj_set_style_local_bg_opa(btnRandom, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_30);
+ lv_obj_set_style_local_value_str(btnRandom, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "Rnd");
+ lv_obj_set_event_cb(btnRandom, event_handler);
+}
+
+SettingPineTimeStyle::~SettingPineTimeStyle() {
+ lv_obj_clean(lv_scr_act());
+ settingsController.SaveSettings();
+}
+
+void SettingPineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
+ auto valueTime = settingsController.GetPTSColorTime();
+ auto valueBar = settingsController.GetPTSColorBar();
+ auto valueBG = settingsController.GetPTSColorBG();
+
+ if (event == LV_EVENT_CLICKED) {
+ if (object == btnNextTime) {
+ 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);
+ 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 == btnNextBar) {
+ valueBar = GetNext(valueBar);
+ if(valueBar == Controllers::Settings::Colors::Black)
+ valueBar = GetNext(valueBar);
+ 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);
+ settingsController.SetPTSColorBar(valueBar);
+ lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBar));
+ }
+ if (object == btnNextBG) {
+ 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);
+ settingsController.SetPTSColorBG(valueBG);
+ lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(valueBG));
+ }
+ if (object == btnReset) {
+ settingsController.SetPTSColorTime(Controllers::Settings::Colors::Teal);
+ lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(Controllers::Settings::Colors::Teal));
+ lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(Controllers::Settings::Colors::Teal));
+ lv_obj_set_style_local_text_color(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(Controllers::Settings::Colors::Teal));
+ settingsController.SetPTSColorBar(Controllers::Settings::Colors::Teal);
+ lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(Controllers::Settings::Colors::Teal));
+ settingsController.SetPTSColorBG(Controllers::Settings::Colors::Black);
+ lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(Controllers::Settings::Colors::Black));
+ }
+ if (object == btnRandom) {
+ uint8_t randTime = rand() % 17;
+ uint8_t randBar = rand() % 17;
+ uint8_t randBG = rand() % 17;
+ // Check if the time color is the same as its background, or if the sidebar is black. If so, change them to more useful values.
+ if (randTime == randBG) {
+ randBG += 1;
+ }
+ if (randBar == 3) {
+ randBar -= 1;
+ }
+ settingsController.SetPTSColorTime(static_cast<Controllers::Settings::Colors>(randTime));
+ lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(static_cast<Controllers::Settings::Colors>(randTime)));
+ lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(static_cast<Controllers::Settings::Colors>(randTime)));
+ lv_obj_set_style_local_text_color(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(static_cast<Controllers::Settings::Colors>(randTime)));
+ settingsController.SetPTSColorBar(static_cast<Controllers::Settings::Colors>(randBar));
+ lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(static_cast<Controllers::Settings::Colors>(randBar)));
+ settingsController.SetPTSColorBG(static_cast<Controllers::Settings::Colors>(randBG));
+ lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(static_cast<Controllers::Settings::Colors>(randBG)));
+ }
+ }
+}
+
+Pinetime::Controllers::Settings::Colors SettingPineTimeStyle::GetNext(Pinetime::Controllers::Settings::Colors color) {
+ auto colorAsInt = static_cast<uint8_t>(color);
+ Pinetime::Controllers::Settings::Colors nextColor;
+ if (colorAsInt < 16) {
+ nextColor = static_cast<Controllers::Settings::Colors>(colorAsInt + 1);
+ } else {
+ nextColor = static_cast<Controllers::Settings::Colors>(0);
+ }
+ return nextColor;
+}
+
+Pinetime::Controllers::Settings::Colors SettingPineTimeStyle::GetPrevious(Pinetime::Controllers::Settings::Colors color) {
+ auto colorAsInt = static_cast<uint8_t>(color);
+ Pinetime::Controllers::Settings::Colors prevColor;
+
+ if (colorAsInt > 0) {
+ prevColor = static_cast<Controllers::Settings::Colors>(colorAsInt - 1);
+ } else {
+ prevColor = static_cast<Controllers::Settings::Colors>(16);
+ }
+ return prevColor;
+}
diff --git a/src/displayapp/screens/settings/SettingPineTimeStyle.h b/src/displayapp/screens/settings/SettingPineTimeStyle.h
new file mode 100644
index 00000000..397bd86d
--- /dev/null
+++ b/src/displayapp/screens/settings/SettingPineTimeStyle.h
@@ -0,0 +1,56 @@
+#pragma once
+
+#include <cstdint>
+#include <lvgl/lvgl.h>
+#include "components/settings/Settings.h"
+#include "displayapp/screens/Screen.h"
+
+namespace Pinetime {
+
+ namespace Applications {
+ namespace Screens {
+
+ class SettingPineTimeStyle : public Screen{
+ public:
+ SettingPineTimeStyle(DisplayApp* app, Pinetime::Controllers::Settings &settingsController);
+ ~SettingPineTimeStyle() override;
+
+ void UpdateSelected(lv_obj_t *object, lv_event_t event);
+
+ private:
+ Controllers::Settings& settingsController;
+
+ Pinetime::Controllers::Settings::Colors GetNext(Controllers::Settings::Colors color);
+ Pinetime::Controllers::Settings::Colors GetPrevious(Controllers::Settings::Colors color);
+
+ lv_obj_t * btnNextTime;
+ lv_obj_t * btnPrevTime;
+ lv_obj_t * btnNextBar;
+ lv_obj_t * btnPrevBar;
+ lv_obj_t * btnNextBG;
+ lv_obj_t * btnPrevBG;
+ lv_obj_t * btnReset;
+ lv_obj_t * btnRandom;
+ lv_obj_t * timebar;
+ lv_obj_t * sidebar;
+ lv_obj_t * timeDD1;
+ lv_obj_t * timeDD2;
+ lv_obj_t * timeAMPM;
+ lv_obj_t * dateDayOfWeek;
+ lv_obj_t * dateDay;
+ lv_obj_t * dateMonth;
+ lv_obj_t * backgroundLabel;
+ lv_obj_t * batteryIcon;
+ lv_obj_t * bleIcon;
+ lv_obj_t * calendarOuter;
+ lv_obj_t * calendarInner;
+ lv_obj_t * calendarBar1;
+ lv_obj_t * calendarBar2;
+ lv_obj_t * calendarCrossBar1;
+ lv_obj_t * calendarCrossBar2;
+ lv_obj_t * stepGauge;
+ lv_color_t needle_colors[1];
+ };
+ }
+ }
+}
diff --git a/src/displayapp/screens/settings/SettingSetDate.cpp b/src/displayapp/screens/settings/SettingSetDate.cpp
index 69766a4e..705b7a95 100644
--- a/src/displayapp/screens/settings/SettingSetDate.cpp
+++ b/src/displayapp/screens/settings/SettingSetDate.cpp
@@ -115,11 +115,6 @@ SettingSetDate::~SettingSetDate() {
lv_obj_clean(lv_scr_act());
}
-bool SettingSetDate::Refresh() {
- return running;
-}
-
-
void SettingSetDate::HandleButtonPress(lv_obj_t *object, lv_event_t event) {
if (event != LV_EVENT_CLICKED)
diff --git a/src/displayapp/screens/settings/SettingSetDate.h b/src/displayapp/screens/settings/SettingSetDate.h
index 0944e986..0f6317d3 100644
--- a/src/displayapp/screens/settings/SettingSetDate.h
+++ b/src/displayapp/screens/settings/SettingSetDate.h
@@ -15,7 +15,6 @@ namespace Pinetime {
SettingSetDate(DisplayApp* app, Pinetime::Controllers::DateTime &dateTimeController);
~SettingSetDate() override;
- bool Refresh() override;
void HandleButtonPress(lv_obj_t *object, lv_event_t event);
private:
diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp
index eae11f5e..7083b80f 100644
--- a/src/displayapp/screens/settings/SettingSetTime.cpp
+++ b/src/displayapp/screens/settings/SettingSetTime.cpp
@@ -113,11 +113,6 @@ SettingSetTime::~SettingSetTime() {
lv_obj_clean(lv_scr_act());
}
-bool SettingSetTime::Refresh() {
- return running;
-}
-
-
void SettingSetTime::HandleButtonPress(lv_obj_t *object, lv_event_t event) {
if (event != LV_EVENT_CLICKED)
diff --git a/src/displayapp/screens/settings/SettingSetTime.h b/src/displayapp/screens/settings/SettingSetTime.h
index da92d6e4..63fb7d3e 100644
--- a/src/displayapp/screens/settings/SettingSetTime.h
+++ b/src/displayapp/screens/settings/SettingSetTime.h
@@ -15,7 +15,6 @@ namespace Pinetime {
SettingSetTime(DisplayApp* app, Pinetime::Controllers::DateTime &dateTimeController);
~SettingSetTime() override;
- bool Refresh() override;
void HandleButtonPress(lv_obj_t *object, lv_event_t event);
private:
diff --git a/src/displayapp/screens/settings/SettingSteps.cpp b/src/displayapp/screens/settings/SettingSteps.cpp
index faa843e6..bec7972b 100644
--- a/src/displayapp/screens/settings/SettingSteps.cpp
+++ b/src/displayapp/screens/settings/SettingSteps.cpp
@@ -70,11 +70,6 @@ SettingSteps::~SettingSteps() {
settingsController.SaveSettings();
}
-bool SettingSteps::Refresh() {
- return running;
-}
-
-
void SettingSteps::UpdateSelected(lv_obj_t *object, lv_event_t event) {
uint32_t value = settingsController.GetStepsGoal();
if(object == btnPlus && (event == LV_EVENT_PRESSED)) {
@@ -95,4 +90,4 @@ void SettingSteps::UpdateSelected(lv_obj_t *object, lv_event_t event) {
}
}
-} \ No newline at end of file
+}
diff --git a/src/displayapp/screens/settings/SettingSteps.h b/src/displayapp/screens/settings/SettingSteps.h
index 0a4c2056..5fc05dee 100644
--- a/src/displayapp/screens/settings/SettingSteps.h
+++ b/src/displayapp/screens/settings/SettingSteps.h
@@ -10,22 +10,19 @@ namespace Pinetime {
namespace Applications {
namespace Screens {
- class SettingSteps : public Screen{
- public:
- SettingSteps(DisplayApp* app, Pinetime::Controllers::Settings &settingsController);
- ~SettingSteps() override;
+ class SettingSteps : public Screen {
+ public:
+ SettingSteps(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
+ ~SettingSteps() override;
- bool Refresh() override;
- void UpdateSelected(lv_obj_t *object, lv_event_t event);
-
- private:
+ void UpdateSelected(lv_obj_t* object, lv_event_t event);
- Controllers::Settings& settingsController;
+ private:
+ Controllers::Settings& settingsController;
- lv_obj_t * stepValue;
- lv_obj_t * btnPlus;
- lv_obj_t * btnMinus;
-
+ lv_obj_t* stepValue;
+ lv_obj_t* btnPlus;
+ lv_obj_t* btnMinus;
};
}
}
diff --git a/src/displayapp/screens/settings/SettingTimeFormat.cpp b/src/displayapp/screens/settings/SettingTimeFormat.cpp
index 031a2a72..c99e3a0e 100644
--- a/src/displayapp/screens/settings/SettingTimeFormat.cpp
+++ b/src/displayapp/screens/settings/SettingTimeFormat.cpp
@@ -64,10 +64,6 @@ SettingTimeFormat::~SettingTimeFormat() {
settingsController.SaveSettings();
}
-bool SettingTimeFormat::Refresh() {
- return running;
-}
-
void SettingTimeFormat::UpdateSelected(lv_obj_t* object, lv_event_t event) {
if (event == LV_EVENT_VALUE_CHANGED) {
for (int i = 0; i < optionsTotal; i++) {
@@ -86,4 +82,4 @@ void SettingTimeFormat::UpdateSelected(lv_obj_t* object, lv_event_t event) {
}
}
}
-} \ No newline at end of file
+}
diff --git a/src/displayapp/screens/settings/SettingTimeFormat.h b/src/displayapp/screens/settings/SettingTimeFormat.h
index 9203b45b..eac4bdc9 100644
--- a/src/displayapp/screens/settings/SettingTimeFormat.h
+++ b/src/displayapp/screens/settings/SettingTimeFormat.h
@@ -15,7 +15,6 @@ namespace Pinetime {
SettingTimeFormat(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
~SettingTimeFormat() override;
- bool Refresh() override;
void UpdateSelected(lv_obj_t* object, lv_event_t event);
private:
diff --git a/src/displayapp/screens/settings/SettingWakeUp.cpp b/src/displayapp/screens/settings/SettingWakeUp.cpp
index cce9a60d..d999004b 100644
--- a/src/displayapp/screens/settings/SettingWakeUp.cpp
+++ b/src/displayapp/screens/settings/SettingWakeUp.cpp
@@ -72,10 +72,6 @@ SettingWakeUp::~SettingWakeUp() {
settingsController.SaveSettings();
}
-bool SettingWakeUp::Refresh() {
- return running;
-}
-
void SettingWakeUp::UpdateSelected(lv_obj_t* object, lv_event_t event) {
using WakeUpMode = Pinetime::Controllers::Settings::WakeUpMode;
if (event == LV_EVENT_VALUE_CHANGED && !ignoringEvents) {
diff --git a/src/displayapp/screens/settings/SettingWakeUp.h b/src/displayapp/screens/settings/SettingWakeUp.h
index 248dd9ac..b9a31dc9 100644
--- a/src/displayapp/screens/settings/SettingWakeUp.h
+++ b/src/displayapp/screens/settings/SettingWakeUp.h
@@ -15,7 +15,6 @@ namespace Pinetime {
SettingWakeUp(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
~SettingWakeUp() override;
- bool Refresh() override;
void UpdateSelected(lv_obj_t* object, lv_event_t event);
private:
diff --git a/src/displayapp/screens/settings/SettingWatchFace.cpp b/src/displayapp/screens/settings/SettingWatchFace.cpp
index 02b90816..cdec704c 100644
--- a/src/displayapp/screens/settings/SettingWatchFace.cpp
+++ b/src/displayapp/screens/settings/SettingWatchFace.cpp
@@ -75,10 +75,6 @@ SettingWatchFace::~SettingWatchFace() {
settingsController.SaveSettings();
}
-bool SettingWatchFace::Refresh() {
- return running;
-}
-
void SettingWatchFace::UpdateSelected(lv_obj_t* object, lv_event_t event) {
if (event == LV_EVENT_VALUE_CHANGED) {
for (uint8_t i = 0; i < optionsTotal; i++) {
diff --git a/src/displayapp/screens/settings/SettingWatchFace.h b/src/displayapp/screens/settings/SettingWatchFace.h
index 1930a228..d4a96c6d 100644
--- a/src/displayapp/screens/settings/SettingWatchFace.h
+++ b/src/displayapp/screens/settings/SettingWatchFace.h
@@ -15,7 +15,6 @@ namespace Pinetime {
SettingWatchFace(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
~SettingWatchFace() override;
- bool Refresh() override;
void UpdateSelected(lv_obj_t* object, lv_event_t event);
private:
diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp
index 6059dfb1..1daf311e 100644
--- a/src/displayapp/screens/settings/Settings.cpp
+++ b/src/displayapp/screens/settings/Settings.cpp
@@ -29,13 +29,6 @@ Settings::~Settings() {
lv_obj_clean(lv_scr_act());
}
-bool Settings::Refresh() {
-
- if (running)
- running = screens.Refresh();
- return running;
-}
-
bool Settings::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
return screens.OnTouchEvent(event);
}
@@ -58,7 +51,7 @@ std::unique_ptr<Screen> Settings::CreateScreen2() {
{Symbols::shoe, "Steps", Apps::SettingSteps},
{Symbols::clock, "Set date", Apps::SettingSetDate},
{Symbols::clock, "Set time", Apps::SettingSetTime},
- {Symbols::batteryHalf, "Battery", Apps::BatteryInfo},
+ {Symbols::batteryHalf, "Battery", Apps::BatteryInfo}
}};
return std::make_unique<Screens::List>(1, 3, app, settingsController, applications);
@@ -67,8 +60,10 @@ std::unique_ptr<Screen> Settings::CreateScreen2() {
std::unique_ptr<Screen> Settings::CreateScreen3() {
std::array<Screens::List::Applications, 4> applications {{
+ {Symbols::paintbrush, "PTS Colors", Apps::SettingPineTimeStyle},
{Symbols::check, "Firmware", Apps::FirmwareValidation},
{Symbols::list, "About", Apps::SysInfo},
+ {Symbols::none, "None", Apps::None},
}};
return std::make_unique<Screens::List>(2, 3, app, settingsController, applications);
diff --git a/src/displayapp/screens/settings/Settings.h b/src/displayapp/screens/settings/Settings.h
index 12dd0514..6c54cdeb 100644
--- a/src/displayapp/screens/settings/Settings.h
+++ b/src/displayapp/screens/settings/Settings.h
@@ -14,8 +14,6 @@ namespace Pinetime {
Settings(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
~Settings() override;
- bool Refresh() override;
-
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
private: