InfiniTime.git

commit a0ba80882c55e5bd6e1636916fdbadd1c7c4a069

Author: Kieran Cawthray <kieranc@gmail.com>

Initial mockup

 src/displayapp/fonts/fonts.json | 2 
 src/displayapp/screens/Symbols.h | 1 
 src/displayapp/screens/WatchFacePineTimeStyle.cpp | 89 +++++++++++++---
 src/displayapp/screens/WatchFacePineTimeStyle.h | 9 +


diff --git a/src/displayapp/fonts/fonts.json b/src/displayapp/fonts/fonts.json
index 9f228fb6aabf5f1bba309c320979fabe8b4a938c..c0ea7439e170cc97f8d957576b29e3b5a3f81ce4 100644
--- a/src/displayapp/fonts/fonts.json
+++ b/src/displayapp/fonts/fonts.json
@@ -58,7 +58,7 @@    "lv_font_sys_48": {
       "sources": [
          {
             "file": "material-design-icons/MaterialIcons-Regular.ttf",
-            "range": "0xf00b, 0xe3aa-0xe3ac, 0xe7f6-0xe7f7, 0xe8b8"
+            "range": "0xf00b, 0xe3aa-0xe3ac, 0xe7f6-0xe7f7, 0xe8b8, 0xe40a"
          }
       ],
       "bpp": 1,




diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h
index c6e76e360df20a845db5ddb206739766641b7015..b21e9366b053f7c48b9f3f4f2e6d210d1a0b70d3 100644
--- a/src/displayapp/screens/Symbols.h
+++ b/src/displayapp/screens/Symbols.h
@@ -49,6 +49,7 @@         static constexpr const char* notificationsOff = "\xEE\x9F\xB6";
         static constexpr const char* notificationsOn = "\xEE\x9F\xB7";
 
         static constexpr const char* flashlight = "\xEF\x80\x8B";
+        static constexpr const char* paintbrushLg = "\xEE\x90\x8A";
       }
     }
   }




diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
index 8689a98c854c7278115dfe53e21de4afb6db9a73..9658c1d60bcaef575c02ba86f992c2cc968b63f6 100644
--- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp
+++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
@@ -191,6 +191,18 @@   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);
 
+  stepValue = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
+  lv_label_set_text_static(stepValue, "0");
+  lv_obj_align(stepValue, sidebar, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
+  lv_obj_set_hidden(stepValue, true);
+
+  stepIcon = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
+  lv_label_set_text_static(stepIcon, Symbols::shoe);
+  lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_TOP_MID, 0, 0);
+  lv_obj_set_hidden(stepIcon, true);
+
   btnNextTime = lv_btn_create(lv_scr_act(), nullptr);
   btnNextTime->user_data = this;
   lv_obj_set_size(btnNextTime, 60, 60);
@@ -272,18 +284,38 @@   lv_obj_set_style_local_value_str(btnClose, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "X");
   lv_obj_set_event_cb(btnClose, event_handler);
   lv_obj_set_hidden(btnClose, true);
 
-  btnSet = lv_btn_create(lv_scr_act(), nullptr);
-  btnSet->user_data = this;
-  lv_obj_set_height(btnSet, 150);
-  lv_obj_set_width(btnSet, 150);
-  lv_obj_align(btnSet, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
-  lv_obj_set_style_local_radius(btnSet, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 30);
-  lv_obj_set_style_local_bg_opa(btnSet, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_50);
-  lv_obj_set_event_cb(btnSet, event_handler);
-  lbl_btnSet = lv_label_create(btnSet, nullptr);
-  lv_obj_set_style_local_text_font(lbl_btnSet, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
-  lv_label_set_text_static(lbl_btnSet, Symbols::settings);
-  lv_obj_set_hidden(btnSet, true);
+  btnSteps = lv_btn_create(lv_scr_act(), nullptr);
+  btnSteps->user_data = this;
+  lv_obj_set_size(btnSteps, 120, 60);
+  lv_obj_align(btnSteps, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
+  lv_obj_set_style_local_bg_opa(btnSteps, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_50);
+  lv_obj_set_style_local_value_str(btnSteps, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, "Toggle");
+  lv_obj_set_event_cb(btnSteps, event_handler);
+  lv_obj_set_hidden(btnSteps, true);
+
+  btnSetColor = lv_btn_create(lv_scr_act(), nullptr);
+  btnSetColor->user_data = this;
+  lv_obj_set_size(btnSetColor, 150, 60);
+  lv_obj_align(btnSetColor, lv_scr_act(), LV_ALIGN_CENTER, 0, -40);
+  lv_obj_set_style_local_radius(btnSetColor, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
+  lv_obj_set_style_local_bg_opa(btnSetColor, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_50);
+  lv_obj_set_event_cb(btnSetColor, event_handler);
+  lbl_btnSetColor = lv_label_create(btnSetColor, nullptr);
+  lv_obj_set_style_local_text_font(lbl_btnSetColor, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
+  lv_label_set_text_static(lbl_btnSetColor, Symbols::paintbrushLg);
+  lv_obj_set_hidden(btnSetColor, true);
+
+  btnSetOpts = lv_btn_create(lv_scr_act(), nullptr);
+  btnSetOpts->user_data = this;
+  lv_obj_set_size(btnSetOpts, 150, 60);
+  lv_obj_align(btnSetOpts, lv_scr_act(), LV_ALIGN_CENTER, 0, 40);
+  lv_obj_set_style_local_radius(btnSetOpts, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
+  lv_obj_set_style_local_bg_opa(btnSetOpts, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_50);
+  lv_obj_set_event_cb(btnSetOpts, event_handler);
+  lbl_btnSetOpts = lv_label_create(btnSetOpts, nullptr);
+  lv_obj_set_style_local_text_font(lbl_btnSetOpts, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
+  lv_label_set_text_static(lbl_btnSetOpts, Symbols::settings);
+  lv_obj_set_hidden(btnSetOpts, true);
 
   taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
   Refresh();
@@ -296,7 +328,8 @@ }
 
 bool WatchFacePineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
   if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnRandom)) {
-    lv_obj_set_hidden(btnSet, false);
+    lv_obj_set_hidden(btnSetColor, false);
+    lv_obj_set_hidden(btnSetOpts, false);
     savedTick = lv_tick_get();
     return true;
   }
@@ -317,6 +350,7 @@   lv_obj_set_hidden(btnPrevBG, true);
   lv_obj_set_hidden(btnReset, true);
   lv_obj_set_hidden(btnRandom, true);
   lv_obj_set_hidden(btnClose, true);
+  lv_obj_set_hidden(btnSteps, true);
 }
 
 bool WatchFacePineTimeStyle::OnButtonPushed() {
@@ -433,14 +467,17 @@   motionSensorOk = motionController.IsSensorOk();
   if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
     lv_gauge_set_value(stepGauge, 0, (stepCount.Get() / (settingsController.GetStepsGoal() / 100)) % 100);
     lv_obj_realign(stepGauge);
+    lv_label_set_text_fmt(stepValue, "%luK", (stepCount.Get() / 1000));
+    lv_obj_realign(stepValue);
     if (stepCount.Get() > settingsController.GetStepsGoal()) {
       lv_obj_set_style_local_line_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_get_hidden(btnSet)) {
+  if (!lv_obj_get_hidden(btnSetColor)) {
     if ((savedTick > 0) && (lv_tick_get() - savedTick > 3000)) {
-      lv_obj_set_hidden(btnSet, true);
+      lv_obj_set_hidden(btnSetColor, true);
+      lv_obj_set_hidden(btnSetOpts, true);
       savedTick = 0;
     }
   }
@@ -552,8 +589,20 @@     }
     if (object == btnClose) {
       CloseMenu();
     }
-    if (object == btnSet) {
-      lv_obj_set_hidden(btnSet, true);
+    if (object == btnSteps) {
+      if (!lv_obj_get_hidden(stepGauge)) {
+        lv_obj_set_hidden(stepGauge, true);
+        lv_obj_set_hidden(stepValue, false);
+        lv_obj_set_hidden(stepIcon, false);
+      } else {
+        lv_obj_set_hidden(stepGauge, false);
+        lv_obj_set_hidden(stepValue, true);
+        lv_obj_set_hidden(stepIcon, true);
+      }
+    }
+    if (object == btnSetColor) {
+      lv_obj_set_hidden(btnSetColor, true);
+      lv_obj_set_hidden(btnSetOpts, true);
       lv_obj_set_hidden(btnNextTime, false);
       lv_obj_set_hidden(btnPrevTime, false);
       lv_obj_set_hidden(btnNextBar, false);
@@ -562,6 +611,12 @@       lv_obj_set_hidden(btnNextBG, false);
       lv_obj_set_hidden(btnPrevBG, false);
       lv_obj_set_hidden(btnReset, false);
       lv_obj_set_hidden(btnRandom, false);
+      lv_obj_set_hidden(btnClose, false);
+    }
+    if (object == btnSetOpts) {
+      lv_obj_set_hidden(btnSetColor, true);
+      lv_obj_set_hidden(btnSetOpts, true);
+      lv_obj_set_hidden(btnSteps, false);
       lv_obj_set_hidden(btnClose, false);
     }
   }




diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.h b/src/displayapp/screens/WatchFacePineTimeStyle.h
index 6f44f94346c938fe734ee90abf2ac0aed9fcac95..e769bfff0ec79c572c7861b7c8fbbd832ce41da2 100644
--- a/src/displayapp/screens/WatchFacePineTimeStyle.h
+++ b/src/displayapp/screens/WatchFacePineTimeStyle.h
@@ -71,6 +71,7 @@         lv_obj_t* btnPrevBG;
         lv_obj_t* btnReset;
         lv_obj_t* btnRandom;
         lv_obj_t* btnClose;
+        lv_obj_t* btnSteps;
         lv_obj_t* timebar;
         lv_obj_t* sidebar;
         lv_obj_t* timeDD1;
@@ -89,8 +90,12 @@         lv_obj_t* calendarCrossBar1;
         lv_obj_t* calendarCrossBar2;
         lv_obj_t* notificationIcon;
         lv_obj_t* stepGauge;
-        lv_obj_t* btnSet;
-        lv_obj_t* lbl_btnSet;
+        lv_obj_t* btnSetColor;
+        lv_obj_t* btnSetOpts;
+        lv_obj_t* lbl_btnSetColor;
+        lv_obj_t* lbl_btnSetOpts;
+        lv_obj_t* stepIcon;
+        lv_obj_t* stepValue;
         lv_color_t needle_colors[1];
 
         BatteryIcon batteryIcon;