Skip to content

Commit 3b28cb8

Browse files
author
Olivier ROMAN
committed
using namespace to be less verbose
1 parent 4ee626b commit 3b28cb8

File tree

11 files changed

+164
-149
lines changed

11 files changed

+164
-149
lines changed

src/displayapp/InfiniTimeTheme.cpp

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ static void style_init_reset(lv_style_t* style) {
5353
}
5454

5555
static void basic_init() {
56+
using namespace Colors;
57+
5658
style_init_reset(&style_bg);
5759
lv_style_set_bg_opa(&style_bg, LV_STATE_DEFAULT, LV_OPA_COVER);
58-
lv_style_set_bg_color(&style_bg, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Black));
60+
lv_style_set_bg_color(&style_bg, LV_STATE_DEFAULT, Color(Black));
5961
lv_style_set_text_font(&style_bg, LV_STATE_DEFAULT, theme.font_normal);
6062

6163
style_init_reset(&style_box);
@@ -64,8 +66,8 @@ static void basic_init() {
6466
lv_style_set_value_font(&style_box, LV_STATE_DEFAULT, theme.font_normal);
6567

6668
style_init_reset(&style_label_white);
67-
lv_style_set_text_color(&style_label_white, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
68-
lv_style_set_text_color(&style_label_white, LV_STATE_DISABLED, Colors::Color(Colors::Named::Gray));
69+
lv_style_set_text_color(&style_label_white, LV_STATE_DEFAULT, Color(White));
70+
lv_style_set_text_color(&style_label_white, LV_STATE_DISABLED, Color(Gray));
6971

7072
style_init_reset(&style_btn);
7173
lv_style_set_radius(&style_btn, LV_STATE_DEFAULT, 10);
@@ -74,14 +76,14 @@ static void basic_init() {
7476
lv_style_set_bg_color(&style_btn, LV_STATE_CHECKED, InfiniTimeTheme::Colors::highlight);
7577
lv_style_set_bg_color(&style_btn, LV_STATE_DISABLED, InfiniTimeTheme::Colors::bgDark);
7678

77-
lv_style_set_text_color(&style_btn, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
78-
lv_style_set_text_color(&style_btn, LV_STATE_DISABLED, Colors::Color(Colors::Named::Gray));
79+
lv_style_set_text_color(&style_btn, LV_STATE_DEFAULT, Color(White));
80+
lv_style_set_text_color(&style_btn, LV_STATE_DISABLED, Color(Gray));
7981

8082
lv_style_set_pad_all(&style_btn, LV_STATE_DEFAULT, LV_DPX(20));
8183
lv_style_set_pad_inner(&style_btn, LV_STATE_DEFAULT, LV_DPX(15));
8284

8385
style_init_reset(&style_icon);
84-
lv_style_set_text_color(&style_icon, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
86+
lv_style_set_text_color(&style_icon, LV_STATE_DEFAULT, Color(White));
8587

8688
style_init_reset(&style_bar_indic);
8789
lv_style_set_bg_opa(&style_bar_indic, LV_STATE_DEFAULT, LV_OPA_COVER);
@@ -90,17 +92,17 @@ static void basic_init() {
9092
style_init_reset(&style_scrollbar);
9193
lv_style_set_bg_opa(&style_scrollbar, LV_STATE_DEFAULT, LV_OPA_COVER);
9294
lv_style_set_radius(&style_scrollbar, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
93-
lv_style_set_bg_color(&style_scrollbar, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
95+
lv_style_set_bg_color(&style_scrollbar, LV_STATE_DEFAULT, Color(White));
9496
lv_style_set_size(&style_scrollbar, LV_STATE_DEFAULT, LV_HOR_RES / 80);
9597
lv_style_set_pad_right(&style_scrollbar, LV_STATE_DEFAULT, LV_HOR_RES / 60);
9698

9799
style_init_reset(&style_list_btn);
98100
lv_style_set_bg_opa(&style_list_btn, LV_STATE_DEFAULT, LV_OPA_COVER);
99-
lv_style_set_bg_color(&style_list_btn, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
101+
lv_style_set_bg_color(&style_list_btn, LV_STATE_DEFAULT, Color(White));
100102
lv_style_set_text_color(&style_list_btn, LV_STATE_DEFAULT, InfiniTimeTheme::Colors::bg);
101-
lv_style_set_text_color(&style_list_btn, LV_STATE_CHECKED, Colors::Color(Colors::Named::White));
103+
lv_style_set_text_color(&style_list_btn, LV_STATE_CHECKED, Color(White));
102104
lv_style_set_image_recolor(&style_list_btn, LV_STATE_DEFAULT, InfiniTimeTheme::Colors::bg);
103-
lv_style_set_image_recolor(&style_list_btn, LV_STATE_CHECKED, Colors::Color(Colors::Named::White));
105+
lv_style_set_image_recolor(&style_list_btn, LV_STATE_CHECKED, Color(White));
104106
lv_style_set_pad_left(&style_list_btn, LV_STATE_DEFAULT, LV_HOR_RES / 25);
105107
lv_style_set_pad_right(&style_list_btn, LV_STATE_DEFAULT, LV_HOR_RES / 25);
106108
lv_style_set_pad_top(&style_list_btn, LV_STATE_DEFAULT, LV_HOR_RES / 100);
@@ -111,7 +113,7 @@ static void basic_init() {
111113
// Causes lag unfortunately, so we'll have to live with the selected item overflowing the corner
112114
// lv_style_set_clip_corner(&style_ddlist_list, LV_STATE_DEFAULT, true);
113115
lv_style_set_text_line_space(&style_ddlist_list, LV_STATE_DEFAULT, LV_VER_RES / 25);
114-
lv_style_set_bg_color(&style_ddlist_list, LV_STATE_DEFAULT, Colors::Color(Colors::Named::LightGray));
116+
lv_style_set_bg_color(&style_ddlist_list, LV_STATE_DEFAULT, Color(LightGray));
115117
lv_style_set_pad_all(&style_ddlist_list, LV_STATE_DEFAULT, 20);
116118

117119
style_init_reset(&style_ddlist_selected);
@@ -129,22 +131,22 @@ static void basic_init() {
129131

130132
style_init_reset(&style_sw_knob);
131133
lv_style_set_bg_opa(&style_sw_knob, LV_STATE_DEFAULT, LV_OPA_COVER);
132-
lv_style_set_bg_color(&style_sw_knob, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Silver));
133-
lv_style_set_bg_color(&style_sw_knob, LV_STATE_CHECKED, Colors::Color(Colors::Named::White));
134+
lv_style_set_bg_color(&style_sw_knob, LV_STATE_DEFAULT, Color(Silver));
135+
lv_style_set_bg_color(&style_sw_knob, LV_STATE_CHECKED, Color(White));
134136
lv_style_set_radius(&style_sw_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
135137
lv_style_set_pad_all(&style_sw_knob, LV_STATE_DEFAULT, -4);
136138

137139
style_init_reset(&style_slider_knob);
138140
lv_style_set_bg_opa(&style_slider_knob, LV_STATE_DEFAULT, LV_OPA_COVER);
139-
lv_style_set_bg_color(&style_slider_knob, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Red));
140-
lv_style_set_border_color(&style_slider_knob, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
141+
lv_style_set_bg_color(&style_slider_knob, LV_STATE_DEFAULT, Color(Red));
142+
lv_style_set_border_color(&style_slider_knob, LV_STATE_DEFAULT, Color(White));
141143
lv_style_set_border_width(&style_slider_knob, LV_STATE_DEFAULT, 6);
142144
lv_style_set_radius(&style_slider_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
143145
lv_style_set_pad_all(&style_slider_knob, LV_STATE_DEFAULT, 10);
144146
lv_style_set_pad_all(&style_slider_knob, LV_STATE_PRESSED, 14);
145147

146148
style_init_reset(&style_arc_indic);
147-
lv_style_set_line_color(&style_arc_indic, LV_STATE_DEFAULT, Colors::Color(Colors::Named::LightGray));
149+
lv_style_set_line_color(&style_arc_indic, LV_STATE_DEFAULT, Color(LightGray));
148150
lv_style_set_line_width(&style_arc_indic, LV_STATE_DEFAULT, LV_DPX(25));
149151
lv_style_set_line_rounded(&style_arc_indic, LV_STATE_DEFAULT, true);
150152

@@ -157,11 +159,11 @@ static void basic_init() {
157159
lv_style_reset(&style_arc_knob);
158160
lv_style_set_radius(&style_arc_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
159161
lv_style_set_bg_opa(&style_arc_knob, LV_STATE_DEFAULT, LV_OPA_COVER);
160-
lv_style_set_bg_color(&style_arc_knob, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
162+
lv_style_set_bg_color(&style_arc_knob, LV_STATE_DEFAULT, Color(White));
161163
lv_style_set_pad_all(&style_arc_knob, LV_STATE_DEFAULT, LV_DPX(5));
162164

163165
style_init_reset(&style_table_cell);
164-
lv_style_set_border_color(&style_table_cell, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Gray));
166+
lv_style_set_border_color(&style_table_cell, LV_STATE_DEFAULT, Color(Gray));
165167
lv_style_set_border_width(&style_table_cell, LV_STATE_DEFAULT, 1);
166168
lv_style_set_border_side(&style_table_cell, LV_STATE_DEFAULT, LV_BORDER_SIDE_FULL);
167169
lv_style_set_pad_left(&style_table_cell, LV_STATE_DEFAULT, 5);
@@ -182,14 +184,14 @@ static void basic_init() {
182184
lv_style_set_pad_inner(&style_lmeter, LV_STATE_DEFAULT, LV_DPX(30));
183185
lv_style_set_scale_width(&style_lmeter, LV_STATE_DEFAULT, LV_DPX(25));
184186

185-
lv_style_set_line_color(&style_lmeter, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
186-
lv_style_set_scale_grad_color(&style_lmeter, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
187-
lv_style_set_scale_end_color(&style_lmeter, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Gray));
187+
lv_style_set_line_color(&style_lmeter, LV_STATE_DEFAULT, Color(White));
188+
lv_style_set_scale_grad_color(&style_lmeter, LV_STATE_DEFAULT, Color(White));
189+
lv_style_set_scale_end_color(&style_lmeter, LV_STATE_DEFAULT, Color(Gray));
188190
lv_style_set_line_width(&style_lmeter, LV_STATE_DEFAULT, LV_DPX(10));
189191
lv_style_set_scale_end_line_width(&style_lmeter, LV_STATE_DEFAULT, LV_DPX(7));
190192

191193
style_init_reset(&style_chart_serie);
192-
lv_style_set_line_color(&style_chart_serie, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
194+
lv_style_set_line_color(&style_chart_serie, LV_STATE_DEFAULT, Color(White));
193195
lv_style_set_line_width(&style_chart_serie, LV_STATE_DEFAULT, 4);
194196
lv_style_set_size(&style_chart_serie, LV_STATE_DEFAULT, 4);
195197
lv_style_set_bg_opa(&style_chart_serie, LV_STATE_DEFAULT, 0);
@@ -201,7 +203,7 @@ static void basic_init() {
201203
lv_style_reset(&style_cb_bullet);
202204
lv_style_set_radius(&style_cb_bullet, LV_STATE_DEFAULT, LV_DPX(4));
203205
lv_style_set_pattern_image(&style_cb_bullet, LV_STATE_CHECKED, LV_SYMBOL_OK);
204-
lv_style_set_pattern_recolor(&style_cb_bullet, LV_STATE_CHECKED, Colors::Color(Colors::Named::White));
206+
lv_style_set_pattern_recolor(&style_cb_bullet, LV_STATE_CHECKED, Color(White));
205207
lv_style_set_pad_all(&style_cb_bullet, LV_STATE_DEFAULT, LV_DPX(8));
206208
}
207209

@@ -217,8 +219,9 @@ static void basic_init() {
217219
* @return a pointer to reference this theme later
218220
*/
219221
lv_theme_t* lv_pinetime_theme_init() {
220-
theme.color_primary = Colors::Color(Colors::Named::White);
221-
theme.color_secondary = Colors::Color(Colors::Named::Gray);
222+
using namespace Colors;
223+
theme.color_primary = Color(White);
224+
theme.color_secondary = Color(Gray);
222225
theme.font_small = &jetbrains_mono_bold_20;
223226
theme.font_normal = &jetbrains_mono_bold_20;
224227
theme.font_subtitle = &jetbrains_mono_bold_20;

src/displayapp/screens/BatteryInfo.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,22 @@ BatteryInfo::~BatteryInfo() {
5050
}
5151

5252
void BatteryInfo::Refresh() {
53+
using namespace Colors;
5354

5455
batteryPercent = batteryController.PercentRemaining();
5556
batteryVoltage = batteryController.Voltage();
5657

5758
if (batteryController.IsCharging()) {
58-
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Lime));
59+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Color(Lime));
5960
lv_label_set_text_static(status, "Charging");
6061
} else if (batteryPercent == 100) {
61-
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Blue));
62+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Color(Blue));
6263
lv_label_set_text_static(status, "Fully charged");
6364
} else if (batteryPercent < 10) {
64-
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Red));
65+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Color(Red));
6566
lv_label_set_text_static(status, "Battery low");
6667
} else {
67-
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Green));
68+
lv_obj_set_style_local_line_color(chargingArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, Color(Green));
6869
lv_label_set_text_static(status, "Discharging");
6970
}
7071

src/displayapp/screens/Motion.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ Motion::Motion(Controllers::MotionController& motionController) : motionControll
1818
lv_chart_set_point_count(chart, 10);
1919

2020
/*Add 3 data series*/
21-
ser1 = lv_chart_add_series(chart, Colors::Color(Colors::Named::Red));
22-
ser2 = lv_chart_add_series(chart, Colors::Color(Colors::Named::Green));
23-
ser3 = lv_chart_add_series(chart, Colors::Color(Colors::Named::Yellow));
21+
using namespace Colors;
22+
ser1 = lv_chart_add_series(chart, Color(Red));
23+
ser2 = lv_chart_add_series(chart, Color(Green));
24+
ser3 = lv_chart_add_series(chart, Color(Yellow));
2425

2526
lv_chart_init_points(chart, ser1, 0);
2627
lv_chart_init_points(chart, ser2, 0);

src/displayapp/screens/Navigation.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ namespace {
191191
*
192192
*/
193193
Navigation::Navigation(Pinetime::Controllers::NavigationService& nav) : navService(nav) {
194+
using namespace Colors;
195+
194196
const auto& image = GetIcon("flag");
195197
imgFlag = lv_img_create(lv_scr_act(), nullptr);
196198
lv_img_set_auto_size(imgFlag, false);
@@ -199,7 +201,7 @@ Navigation::Navigation(Pinetime::Controllers::NavigationService& nav) : navServi
199201
lv_img_set_offset_x(imgFlag, 0);
200202
lv_img_set_offset_y(imgFlag, image.offset);
201203
lv_obj_set_style_local_image_recolor_opa(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_COVER);
202-
lv_obj_set_style_local_image_recolor(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Cyan));
204+
lv_obj_set_style_local_image_recolor(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, Color(Cyan));
203205
lv_obj_align(imgFlag, nullptr, LV_ALIGN_CENTER, 0, -60);
204206

205207
txtNarrative = lv_label_create(lv_scr_act(), nullptr);
@@ -212,7 +214,7 @@ Navigation::Navigation(Pinetime::Controllers::NavigationService& nav) : navServi
212214

213215
txtManDist = lv_label_create(lv_scr_act(), nullptr);
214216
lv_label_set_long_mode(txtManDist, LV_LABEL_LONG_BREAK);
215-
lv_obj_set_style_local_text_color(txtManDist, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Green));
217+
lv_obj_set_style_local_text_color(txtManDist, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Color(Green));
216218
lv_obj_set_style_local_text_font(txtManDist, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
217219
lv_obj_set_width(txtManDist, LV_HOR_RES);
218220
lv_label_set_text_static(txtManDist, "--M");
@@ -224,7 +226,7 @@ Navigation::Navigation(Pinetime::Controllers::NavigationService& nav) : navServi
224226
lv_obj_set_size(barProgress, 200, 20);
225227
lv_obj_align(barProgress, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, -10);
226228
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_BG, LV_STATE_DEFAULT, Colors::Color(0x222222));
227-
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Orange));
229+
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, Color(Orange));
228230
lv_bar_set_anim_time(barProgress, 500);
229231
lv_bar_set_range(barProgress, 0, 100);
230232
lv_bar_set_value(barProgress, 0, LV_ANIM_OFF);
@@ -238,12 +240,13 @@ Navigation::~Navigation() {
238240
}
239241

240242
void Navigation::Refresh() {
243+
using namespace Colors;
241244
if (flag != navService.getFlag()) {
242245
flag = navService.getFlag();
243246
const auto& image = GetIcon(flag);
244247
lv_img_set_src(imgFlag, image.fileName);
245248
lv_obj_set_style_local_image_recolor_opa(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_COVER);
246-
lv_obj_set_style_local_image_recolor(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Cyan));
249+
lv_obj_set_style_local_image_recolor(imgFlag, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, Color(Cyan));
247250
lv_img_set_offset_y(imgFlag, image.offset);
248251
}
249252

@@ -261,9 +264,9 @@ void Navigation::Refresh() {
261264
progress = navService.getProgress();
262265
lv_bar_set_value(barProgress, progress, LV_ANIM_OFF);
263266
if (progress > 90) {
264-
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Red));
267+
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, Color(Red));
265268
} else {
266-
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Orange));
269+
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, Color(Orange));
267270
}
268271
}
269272
}

src/displayapp/screens/Notifications.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,10 @@ Notifications::NotificationItem::NotificationItem(const char* title,
264264
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
265265
Pinetime::Controllers::MotorController& motorController)
266266
: alertNotificationService {alertNotificationService}, motorController {motorController} {
267+
using namespace Colors;
267268
container = lv_cont_create(lv_scr_act(), nullptr);
268269
lv_obj_set_size(container, LV_HOR_RES, LV_VER_RES);
269-
lv_obj_set_style_local_bg_color(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Black));
270+
lv_obj_set_style_local_bg_color(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, Color(Black));
270271
lv_obj_set_style_local_pad_all(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
271272
lv_obj_set_style_local_pad_inner(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
272273
lv_obj_set_style_local_border_width(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
@@ -287,7 +288,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
287288
lv_obj_align(alert_count, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 16);
288289

289290
lv_obj_t* alert_type = lv_label_create(container, nullptr);
290-
lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Orange));
291+
lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Color(Orange));
291292
if (title == nullptr) {
292293
lv_label_set_text_static(alert_type, "Notification");
293294
} else {
@@ -338,7 +339,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
338339
lv_obj_align(bt_reject, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
339340
label_reject = lv_label_create(bt_reject, nullptr);
340341
lv_label_set_text_static(label_reject, Symbols::phoneSlash);
341-
lv_obj_set_style_local_bg_color(bt_reject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Red));
342+
lv_obj_set_style_local_bg_color(bt_reject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Color(Red));
342343

343344
bt_mute = lv_btn_create(container, nullptr);
344345
bt_mute->user_data = this;
@@ -347,7 +348,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
347348
lv_obj_align(bt_mute, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
348349
label_mute = lv_label_create(bt_mute, nullptr);
349350
lv_label_set_text_static(label_mute, Symbols::volumMute);
350-
lv_obj_set_style_local_bg_color(bt_mute, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::LightGray));
351+
lv_obj_set_style_local_bg_color(bt_mute, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Color(LightGray));
351352
} break;
352353
}
353354
}

src/displayapp/screens/Paddle.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
using namespace Pinetime::Applications::Screens;
88

99
Paddle::Paddle(Pinetime::Components::LittleVgl& lvgl) : lvgl {lvgl} {
10+
using namespace Colors;
1011
background = lv_obj_create(lv_scr_act(), nullptr);
1112
lv_obj_set_size(background, LV_HOR_RES + 1, LV_VER_RES);
1213
lv_obj_set_pos(background, -1, 0);
1314
lv_obj_set_style_local_radius(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
14-
lv_obj_set_style_local_bg_color(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::Black));
15-
lv_obj_set_style_local_border_color(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
15+
lv_obj_set_style_local_bg_color(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Color(Black));
16+
lv_obj_set_style_local_border_color(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Color(White));
1617
lv_obj_set_style_local_border_width(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 1);
1718

1819
points = lv_label_create(lv_scr_act(), nullptr);
@@ -21,12 +22,12 @@ Paddle::Paddle(Pinetime::Components::LittleVgl& lvgl) : lvgl {lvgl} {
2122
lv_obj_align(points, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 10);
2223

2324
paddle = lv_obj_create(lv_scr_act(), nullptr);
24-
lv_obj_set_style_local_bg_color(paddle, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
25+
lv_obj_set_style_local_bg_color(paddle, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Color(White));
2526
lv_obj_set_style_local_radius(paddle, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0);
2627
lv_obj_set_size(paddle, 4, 60);
2728

2829
ball = lv_obj_create(lv_scr_act(), nullptr);
29-
lv_obj_set_style_local_bg_color(ball, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::Color(Colors::Named::White));
30+
lv_obj_set_style_local_bg_color(ball, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Color(White));
3031
lv_obj_set_style_local_radius(ball, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
3132
lv_obj_set_size(ball, ballSize, ballSize);
3233

0 commit comments

Comments
 (0)