aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens/WatchFaceInfineat.h
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2023-01-21 12:31:39 +0200
committerRiku Isokoski <riksu9000@gmail.com>2023-01-26 10:58:47 +0200
commit1feb01b25f7e5a13b1cd96d4612b2aeba33195ca (patch)
tree025a80c75dfcaed83ac0f6e652d9c115a60c1499 /src/displayapp/screens/WatchFaceInfineat.h
parenta3e14c012d76fc8f7ad4c16ad9dc67e8995ce10e (diff)
infineat: Optimize lv_lines
Reduce code duplication massively
Diffstat (limited to 'src/displayapp/screens/WatchFaceInfineat.h')
-rw-r--r--src/displayapp/screens/WatchFaceInfineat.h29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/displayapp/screens/WatchFaceInfineat.h b/src/displayapp/screens/WatchFaceInfineat.h
index 2dbb0ab3..a24a4e9e 100644
--- a/src/displayapp/screens/WatchFaceInfineat.h
+++ b/src/displayapp/screens/WatchFaceInfineat.h
@@ -63,37 +63,10 @@ namespace Pinetime {
lv_obj_t* background;
// Lines making up the side cover
- lv_obj_t* line0;
- lv_obj_t* line1;
- lv_obj_t* line2;
- lv_obj_t* line3;
- lv_obj_t* line4;
- lv_obj_t* line5;
- lv_obj_t* line6;
- lv_obj_t* line7;
- lv_obj_t* line8;
lv_obj_t* lineBattery;
- lv_style_t line0Style;
- lv_style_t line1Style;
- lv_style_t line2Style;
- lv_style_t line3Style;
- lv_style_t line4Style;
- lv_style_t line5Style;
- lv_style_t line6Style;
- lv_style_t line7Style;
- lv_style_t line8Style;
lv_style_t lineBatteryStyle;
- lv_point_t line0Points[2];
- lv_point_t line1Points[2];
- lv_point_t line2Points[2];
- lv_point_t line3Points[2];
- lv_point_t line4Points[2];
- lv_point_t line5Points[2];
- lv_point_t line6Points[2];
- lv_point_t line7Points[2];
- lv_point_t line8Points[2];
lv_point_t lineBatteryPoints[2];
lv_obj_t* logoPine;
@@ -119,6 +92,8 @@ namespace Pinetime {
static constexpr int nLines = 9;
static constexpr int nColors = 7; // must match number of colors in InfineatColors
+ lv_obj_t* lines[nLines];
+
struct InfineatColors {
int orange[nLines] = {0xfd872b, 0xdb3316, 0x6f1000, 0xfd7a0a, 0xffffff, 0xffffff, 0xffffff, 0xe85102, 0xea1c00};
int blue[nLines] = {0xe7f8ff, 0x2232d0, 0x182a8b, 0xe7f8ff, 0xffffff, 0xffffff, 0xffffff, 0x5991ff, 0x1636ff};