Skip to content

Commit e0d0141

Browse files
Riksu9000JF002
authored andcommitted
Ui update
1 parent df8d396 commit e0d0141

10 files changed

Lines changed: 113 additions & 107 deletions

File tree

doc/ui_guidelines.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# UI design guidelines
2+
3+
- Align objects all the way to the edge or corner
4+
- Buttons should generally be at least 50px high
5+
- Buttons should generally be on the bottom edge
6+
- Make interactable objects **big**
7+
- Recommendations for inner padding, aka distance between buttons:
8+
- When aligning 4 objects: 4px, e.g. Settings
9+
- When aligning 3 objects: 6px, e.g. App list
10+
- When aligning 2 objects: 10px, e.g. Quick settings
11+
- When using a page indicator, leave 8px for it on the right side
12+
- It is acceptable to leave 8px on the left side as well to center the content
13+
- Top bar takes at least 20px + padding
14+
- Top bar right icons move 8px to the left when using a page indicator

src/displayapp/screens/FirmwareValidation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ FirmwareValidation::FirmwareValidation(Pinetime::Applications::DisplayApp* app,
3838
lv_label_set_text(labelIsValidated, "Please #00ff00 Validate# this version or\n#ff0000 Reset# to rollback to the previous version.");
3939

4040
buttonValidate = lv_btn_create(lv_scr_act(), nullptr);
41-
lv_obj_align(buttonValidate, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
4241
buttonValidate->user_data = this;
42+
lv_obj_set_height(buttonValidate, 50);
43+
lv_obj_align(buttonValidate, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
4344
lv_obj_set_event_cb(buttonValidate, ButtonEventHandler);
4445
lv_obj_set_style_local_bg_color(buttonValidate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x009900));
4546

@@ -48,6 +49,7 @@ FirmwareValidation::FirmwareValidation(Pinetime::Applications::DisplayApp* app,
4849

4950
buttonReset = lv_btn_create(lv_scr_act(), nullptr);
5051
buttonReset->user_data = this;
52+
lv_obj_set_height(buttonReset, 50);
5153
lv_obj_align(buttonReset, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
5254
lv_obj_set_style_local_bg_color(buttonReset, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x990000));
5355
lv_obj_set_event_cb(buttonReset, ButtonEventHandler);

src/displayapp/screens/List.cpp

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,42 +25,38 @@ List::List(uint8_t screenID,
2525
settingsController.SetSettingsMenu(screenID);
2626

2727
if (numScreens > 1) {
28-
pageIndicatorBasePoints[0].x = 240 - 1;
29-
pageIndicatorBasePoints[0].y = 6;
30-
pageIndicatorBasePoints[1].x = 240 - 1;
31-
pageIndicatorBasePoints[1].y = 240 - 6;
28+
pageIndicatorBasePoints[0].x = LV_HOR_RES - 1;
29+
pageIndicatorBasePoints[0].y = 0;
30+
pageIndicatorBasePoints[1].x = LV_HOR_RES - 1;
31+
pageIndicatorBasePoints[1].y = LV_VER_RES;
3232

3333
pageIndicatorBase = lv_line_create(lv_scr_act(), NULL);
3434
lv_obj_set_style_local_line_width(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
3535
lv_obj_set_style_local_line_color(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
36-
lv_obj_set_style_local_line_rounded(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true);
3736
lv_line_set_points(pageIndicatorBase, pageIndicatorBasePoints, 2);
3837

39-
uint16_t indicatorSize = 228 / numScreens;
40-
uint16_t indicatorPos = indicatorSize * screenID;
38+
const uint16_t indicatorSize = LV_VER_RES / numScreens;
39+
const uint16_t indicatorPos = indicatorSize * screenID;
4140

42-
pageIndicatorPoints[0].x = 240 - 1;
43-
pageIndicatorPoints[0].y = 6 + indicatorPos;
44-
pageIndicatorPoints[1].x = 240 - 1;
45-
pageIndicatorPoints[1].y = 6 + indicatorPos + indicatorSize;
41+
pageIndicatorPoints[0].x = LV_HOR_RES - 1;
42+
pageIndicatorPoints[0].y = indicatorPos;
43+
pageIndicatorPoints[1].x = LV_HOR_RES - 1;
44+
pageIndicatorPoints[1].y = indicatorPos + indicatorSize;
4645

4746
pageIndicator = lv_line_create(lv_scr_act(), NULL);
4847
lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
4948
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
50-
lv_obj_set_style_local_line_rounded(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true);
5149
lv_line_set_points(pageIndicator, pageIndicatorPoints, 2);
5250
}
5351

5452
lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr);
5553

56-
// lv_obj_set_style_local_bg_color(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
5754
lv_obj_set_style_local_bg_opa(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);
58-
lv_obj_set_style_local_pad_all(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 10);
59-
lv_obj_set_style_local_pad_inner(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5);
55+
lv_obj_set_style_local_pad_inner(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 4);
6056
lv_obj_set_style_local_border_width(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
6157

6258
lv_obj_set_pos(container1, 0, 0);
63-
lv_obj_set_width(container1, LV_HOR_RES - 15);
59+
lv_obj_set_width(container1, LV_HOR_RES - 8);
6460
lv_obj_set_height(container1, LV_VER_RES);
6561
lv_cont_set_layout(container1, LV_LAYOUT_COLUMN_LEFT);
6662

@@ -73,11 +69,11 @@ List::List(uint8_t screenID,
7369

7470
itemApps[i] = lv_btn_create(container1, nullptr);
7571
lv_obj_set_style_local_bg_opa(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_20);
76-
lv_obj_set_style_local_radius(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
72+
lv_obj_set_style_local_radius(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 57);
7773
lv_obj_set_style_local_bg_color(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
7874

79-
lv_obj_set_width(itemApps[i], LV_HOR_RES - 25);
80-
lv_obj_set_height(itemApps[i], 52);
75+
lv_obj_set_width(itemApps[i], LV_HOR_RES - 8);
76+
lv_obj_set_height(itemApps[i], 57);
8177
lv_obj_set_event_cb(itemApps[i], ButtonEventHandler);
8278
lv_btn_set_layout(itemApps[i], LV_LAYOUT_ROW_MID);
8379
itemApps[i]->user_data = this;

src/displayapp/screens/Music.cpp

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,60 +50,55 @@ inline void lv_img_set_src_arr(lv_obj_t* img, const lv_img_dsc_t* src_img) {
5050
Music::Music(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::MusicService& music) : Screen(app), musicService(music) {
5151
lv_obj_t* label;
5252

53+
lv_style_init(&btn_style);
54+
lv_style_set_radius(&btn_style, LV_STATE_DEFAULT, 20);
55+
lv_style_set_bg_color(&btn_style, LV_STATE_DEFAULT, LV_COLOR_AQUA);
56+
lv_style_set_bg_opa(&btn_style, LV_STATE_DEFAULT, LV_OPA_20);
57+
5358
btnVolDown = lv_btn_create(lv_scr_act(), nullptr);
5459
btnVolDown->user_data = this;
5560
lv_obj_set_event_cb(btnVolDown, event_handler);
56-
lv_obj_set_size(btnVolDown, 65, 75);
57-
lv_obj_align(btnVolDown, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 15, -10);
58-
lv_obj_set_style_local_radius(btnVolDown, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
59-
lv_obj_set_style_local_bg_color(btnVolDown, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
60-
lv_obj_set_style_local_bg_opa(btnVolDown, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_20);
61+
lv_obj_set_size(btnVolDown, 76, 76);
62+
lv_obj_align(btnVolDown, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
63+
lv_obj_add_style(btnVolDown, LV_STATE_DEFAULT, &btn_style);
6164
label = lv_label_create(btnVolDown, nullptr);
6265
lv_label_set_text(label, Symbols::volumDown);
63-
lv_obj_set_hidden(btnVolDown, !displayVolumeButtons);
66+
lv_obj_set_hidden(btnVolDown, true);
6467

6568
btnVolUp = lv_btn_create(lv_scr_act(), nullptr);
6669
btnVolUp->user_data = this;
6770
lv_obj_set_event_cb(btnVolUp, event_handler);
68-
lv_obj_set_size(btnVolUp, 65, 75);
69-
lv_obj_align(btnVolUp, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -15, -10);
70-
lv_obj_set_style_local_radius(btnVolUp, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
71-
lv_obj_set_style_local_bg_color(btnVolUp, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
72-
lv_obj_set_style_local_bg_opa(btnVolUp, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_20);
71+
lv_obj_set_size(btnVolUp, 76, 76);
72+
lv_obj_align(btnVolUp, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
73+
lv_obj_add_style(btnVolUp, LV_STATE_DEFAULT, &btn_style);
7374
label = lv_label_create(btnVolUp, nullptr);
7475
lv_label_set_text(label, Symbols::volumUp);
75-
lv_obj_set_hidden(btnVolUp, !displayVolumeButtons);
76+
lv_obj_set_hidden(btnVolUp, true);
7677

7778
btnPrev = lv_btn_create(lv_scr_act(), nullptr);
7879
btnPrev->user_data = this;
7980
lv_obj_set_event_cb(btnPrev, event_handler);
80-
lv_obj_set_size(btnPrev, 65, 75);
81-
lv_obj_align(btnPrev, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 15, -10);
82-
lv_obj_set_style_local_radius(btnPrev, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
83-
lv_obj_set_style_local_bg_color(btnPrev, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
84-
lv_obj_set_style_local_bg_opa(btnPrev, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_20);
81+
lv_obj_set_size(btnPrev, 76, 76);
82+
lv_obj_align(btnPrev, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
83+
lv_obj_add_style(btnPrev, LV_STATE_DEFAULT, &btn_style);
8584
label = lv_label_create(btnPrev, nullptr);
8685
lv_label_set_text(label, Symbols::stepBackward);
8786

8887
btnNext = lv_btn_create(lv_scr_act(), nullptr);
8988
btnNext->user_data = this;
9089
lv_obj_set_event_cb(btnNext, event_handler);
91-
lv_obj_set_size(btnNext, 65, 75);
92-
lv_obj_align(btnNext, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, -15, -10);
93-
lv_obj_set_style_local_radius(btnNext, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
94-
lv_obj_set_style_local_bg_color(btnNext, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
95-
lv_obj_set_style_local_bg_opa(btnNext, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_20);
90+
lv_obj_set_size(btnNext, 76, 76);
91+
lv_obj_align(btnNext, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
92+
lv_obj_add_style(btnNext, LV_STATE_DEFAULT, &btn_style);
9693
label = lv_label_create(btnNext, nullptr);
9794
lv_label_set_text(label, Symbols::stepForward);
9895

9996
btnPlayPause = lv_btn_create(lv_scr_act(), nullptr);
10097
btnPlayPause->user_data = this;
10198
lv_obj_set_event_cb(btnPlayPause, event_handler);
102-
lv_obj_set_size(btnPlayPause, 65, 75);
103-
lv_obj_align(btnPlayPause, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, -10);
104-
lv_obj_set_style_local_radius(btnPlayPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 20);
105-
lv_obj_set_style_local_bg_color(btnPlayPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
106-
lv_obj_set_style_local_bg_opa(btnPlayPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_20);
99+
lv_obj_set_size(btnPlayPause, 76, 76);
100+
lv_obj_align(btnPlayPause, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
101+
lv_obj_add_style(btnPlayPause, LV_STATE_DEFAULT, &btn_style);
107102
txtPlayPause = lv_label_create(btnPlayPause, nullptr);
108103
lv_label_set_text(txtPlayPause, Symbols::play);
109104

@@ -147,6 +142,7 @@ Music::Music(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Mus
147142
}
148143

149144
Music::~Music() {
145+
lv_style_reset(&btn_style);
150146
lv_obj_clean(lv_scr_act());
151147
}
152148

@@ -272,21 +268,19 @@ void Music::OnObjectEvent(lv_obj_t* obj, lv_event_t event) {
272268
bool Music::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
273269
switch (event) {
274270
case TouchEvents::SwipeUp: {
275-
displayVolumeButtons = true;
276-
lv_obj_set_hidden(btnVolDown, !displayVolumeButtons);
277-
lv_obj_set_hidden(btnVolUp, !displayVolumeButtons);
271+
lv_obj_set_hidden(btnVolDown, false);
272+
lv_obj_set_hidden(btnVolUp, false);
278273

279-
lv_obj_set_hidden(btnNext, displayVolumeButtons);
280-
lv_obj_set_hidden(btnPrev, displayVolumeButtons);
274+
lv_obj_set_hidden(btnNext, true);
275+
lv_obj_set_hidden(btnPrev, true);
281276
return true;
282277
}
283278
case TouchEvents::SwipeDown: {
284-
displayVolumeButtons = false;
285-
lv_obj_set_hidden(btnNext, displayVolumeButtons);
286-
lv_obj_set_hidden(btnPrev, displayVolumeButtons);
279+
lv_obj_set_hidden(btnNext, false);
280+
lv_obj_set_hidden(btnPrev, false);
287281

288-
lv_obj_set_hidden(btnVolDown, !displayVolumeButtons);
289-
lv_obj_set_hidden(btnVolUp, !displayVolumeButtons);
282+
lv_obj_set_hidden(btnVolDown, true);
283+
lv_obj_set_hidden(btnVolUp, true);
290284
return true;
291285
}
292286
case TouchEvents::SwipeLeft: {

src/displayapp/screens/Music.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ namespace Pinetime {
5757
lv_obj_t* imgDiscAnim;
5858
lv_obj_t* txtTrackDuration;
5959

60+
lv_style_t btn_style;
61+
6062
/** For the spinning disc animation */
6163
bool frameB;
6264

63-
bool displayVolumeButtons = false;
6465
Pinetime::Controllers::MusicService& musicService;
6566

6667
std::string artist;

src/displayapp/screens/Tile.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,35 @@ Tile::Tile(uint8_t screenID,
3535
label_time = lv_label_create(lv_scr_act(), nullptr);
3636
lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes());
3737
lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER);
38-
lv_obj_align(label_time, nullptr, LV_ALIGN_IN_TOP_LEFT, 15, 6);
38+
lv_obj_align(label_time, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);
3939

4040
// Battery
4141
batteryIcon = lv_label_create(lv_scr_act(), nullptr);
4242
lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining()));
43-
lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, -15, 6);
43+
lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, -8, 0);
4444

4545
if (numScreens > 1) {
46-
pageIndicatorBasePoints[0].x = 240 - 1;
47-
pageIndicatorBasePoints[0].y = 6;
48-
pageIndicatorBasePoints[1].x = 240 - 1;
49-
pageIndicatorBasePoints[1].y = 240 - 6;
46+
pageIndicatorBasePoints[0].x = LV_HOR_RES - 1;
47+
pageIndicatorBasePoints[0].y = 0;
48+
pageIndicatorBasePoints[1].x = LV_HOR_RES - 1;
49+
pageIndicatorBasePoints[1].y = LV_VER_RES;
5050

5151
pageIndicatorBase = lv_line_create(lv_scr_act(), nullptr);
5252
lv_obj_set_style_local_line_width(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
5353
lv_obj_set_style_local_line_color(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
54-
lv_obj_set_style_local_line_rounded(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true);
5554
lv_line_set_points(pageIndicatorBase, pageIndicatorBasePoints, 2);
5655

57-
uint16_t indicatorSize = 228 / numScreens;
58-
uint16_t indicatorPos = indicatorSize * screenID;
56+
const uint16_t indicatorSize = LV_VER_RES / numScreens;
57+
const uint16_t indicatorPos = indicatorSize * screenID;
5958

60-
pageIndicatorPoints[0].x = 240 - 1;
61-
pageIndicatorPoints[0].y = 6 + indicatorPos;
62-
pageIndicatorPoints[1].x = 240 - 1;
63-
pageIndicatorPoints[1].y = 6 + indicatorPos + indicatorSize;
59+
pageIndicatorPoints[0].x = LV_HOR_RES - 1;
60+
pageIndicatorPoints[0].y = indicatorPos;
61+
pageIndicatorPoints[1].x = LV_HOR_RES - 1;
62+
pageIndicatorPoints[1].y = indicatorPos + indicatorSize;
6463

6564
pageIndicator = lv_line_create(lv_scr_act(), nullptr);
6665
lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
6766
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
68-
lv_obj_set_style_local_line_rounded(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true);
6967
lv_line_set_points(pageIndicator, pageIndicatorPoints, 2);
7068
}
7169

@@ -85,14 +83,16 @@ Tile::Tile(uint8_t screenID,
8583

8684
btnm1 = lv_btnmatrix_create(lv_scr_act(), nullptr);
8785
lv_btnmatrix_set_map(btnm1, btnmMap);
88-
lv_obj_set_size(btnm1, LV_HOR_RES - 10, LV_VER_RES - 60);
86+
lv_obj_set_size(btnm1, LV_HOR_RES - 16, LV_VER_RES - 60);
8987
lv_obj_align(btnm1, NULL, LV_ALIGN_CENTER, 0, 10);
9088

9189
lv_obj_set_style_local_radius(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, 20);
9290
lv_obj_set_style_local_bg_opa(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, LV_OPA_20);
9391
lv_obj_set_style_local_bg_color(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
9492
lv_obj_set_style_local_bg_opa(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DISABLED, LV_OPA_20);
9593
lv_obj_set_style_local_bg_color(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DISABLED, lv_color_hex(0x111111));
94+
lv_obj_set_style_local_pad_all(btnm1, LV_BTNMATRIX_PART_BG, LV_STATE_DEFAULT, 0);
95+
lv_obj_set_style_local_pad_inner(btnm1, LV_BTNMATRIX_PART_BG, LV_STATE_DEFAULT, 6);
9696

9797
for (uint8_t i = 0; i < 6; i++) {
9898
if (applications[i].application == Apps::None) {

src/displayapp/screens/WatchFaceAnalog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
6767

6868
batteryIcon = lv_label_create(lv_scr_act(), nullptr);
6969
lv_label_set_text(batteryIcon, Symbols::batteryHalf);
70-
lv_obj_align(batteryIcon, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, -8, -4);
70+
lv_obj_align(batteryIcon, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
7171

7272
notificationIcon = lv_label_create(lv_scr_act(), NULL);
7373
lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00));
7474
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false));
75-
lv_obj_align(notificationIcon, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 8, -4);
75+
lv_obj_align(notificationIcon, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
7676

7777
// Date - Day / Week day
7878

src/displayapp/screens/WatchFaceDigital.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
3535

3636
batteryIcon = lv_label_create(lv_scr_act(), nullptr);
3737
lv_label_set_text(batteryIcon, Symbols::batteryFull);
38-
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, -5, 2);
38+
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0);
3939

4040
batteryPlug = lv_label_create(lv_scr_act(), nullptr);
4141
lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFF0000));
@@ -50,7 +50,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
5050
notificationIcon = lv_label_create(lv_scr_act(), nullptr);
5151
lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FF00));
5252
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false));
53-
lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 10, 0);
53+
lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);
5454

5555
label_date = lv_label_create(lv_scr_act(), nullptr);
5656
lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_CENTER, 0, 60);
@@ -75,7 +75,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
7575
heartbeatIcon = lv_label_create(lv_scr_act(), nullptr);
7676
lv_label_set_text(heartbeatIcon, Symbols::heartBeat);
7777
lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
78-
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
78+
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
7979

8080
heartbeatValue = lv_label_create(lv_scr_act(), nullptr);
8181
lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
@@ -85,7 +85,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
8585
stepValue = lv_label_create(lv_scr_act(), nullptr);
8686
lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7));
8787
lv_label_set_text(stepValue, "0");
88-
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
88+
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
8989

9090
stepIcon = lv_label_create(lv_scr_act(), nullptr);
9191
lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7));
@@ -110,7 +110,7 @@ bool WatchFaceDigital::Refresh() {
110110
if (bleState.IsUpdated()) {
111111
lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get()));
112112
}
113-
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, -5, 5);
113+
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0);
114114
lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0);
115115
lv_obj_align(bleIcon, batteryPlug, LV_ALIGN_OUT_LEFT_MID, -5, 0);
116116

@@ -208,15 +208,15 @@ bool WatchFaceDigital::Refresh() {
208208
lv_label_set_text_static(heartbeatValue, "");
209209
}
210210

211-
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
211+
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
212212
lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
213213
}
214214

215215
stepCount = motionController.NbSteps();
216216
motionSensorOk = motionController.IsSensorOk();
217217
if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
218218
lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get());
219-
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
219+
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
220220
lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
221221
}
222222

0 commit comments

Comments
 (0)