Skip to content

Commit 8fdb673

Browse files
committed
fw/apps/system_apps: use compile options to enable new MenuLayer capabilities
Signed-off-by: Paul Chanvin <[email protected]>
1 parent fc9a2a9 commit 8fdb673

File tree

11 files changed

+126
-0
lines changed

11 files changed

+126
-0
lines changed

src/fw/apps/system_apps/alarms/alarm_editor.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,15 @@ static void prv_setup_day_picker_window(AlarmEditorData *data) {
259259
ALARMS_APP_HIGHLIGHT_COLOR,
260260
GColorWhite);
261261
menu_layer_set_click_config_onto_window(&data->day_picker_menu_layer, &data->day_picker_window);
262+
#if FW_APPS_MENUS_WRAP
263+
menu_layer_set_scroll_wrap_around(&data->day_picker_menu_layer, true);
264+
#endif
265+
#if FW_APPS_MENUS_VIBE_ON_WRAP
266+
menu_layer_set_scroll_vibe_on_wrap(&data->day_picker_menu_layer, true);
267+
#endif
268+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
269+
menu_layer_set_scroll_vibe_on_blocked(&data->day_picker_menu_layer, true);
270+
#endif
262271
layer_add_child(&data->day_picker_window.layer,
263272
menu_layer_get_layer(&data->day_picker_menu_layer));
264273
if (!alarm_get_kind(data->alarm_id, &data->alarm_kind)) {
@@ -414,6 +423,15 @@ static void prv_setup_custom_day_picker_window(AlarmEditorData *data) {
414423
GColorWhite);
415424
menu_layer_set_click_config_onto_window(&data->custom_day_picker_menu_layer,
416425
&data->custom_day_picker_window);
426+
#if FW_APPS_MENUS_WRAP
427+
menu_layer_set_scroll_wrap_around(&data->custom_day_picker_menu_layer, true);
428+
#endif
429+
#if FW_APPS_MENUS_VIBE_ON_WRAP
430+
menu_layer_set_scroll_vibe_on_wrap(&data->custom_day_picker_menu_layer, true);
431+
#endif
432+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
433+
menu_layer_set_scroll_vibe_on_blocked(&data->custom_day_picker_menu_layer, true);
434+
#endif
417435
layer_add_child(&data->custom_day_picker_window.layer,
418436
menu_layer_get_layer(&data->custom_day_picker_menu_layer));
419437
gbitmap_init_with_resource(&data->selected_icon, RESOURCE_ID_CHECKBOX_ICON_CHECKED);

src/fw/apps/system_apps/alarms/alarms.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,15 @@ static void prv_handle_init(void) {
402402

403403
menu_layer_set_highlight_colors(&data->menu_layer, ALARMS_APP_HIGHLIGHT_COLOR, GColorWhite);
404404
menu_layer_set_click_config_onto_window(&data->menu_layer, &data->window);
405+
#if FW_APPS_MENUS_WRAP
406+
menu_layer_set_scroll_wrap_around(&data->menu_layer, true);
407+
#endif
408+
#if FW_APPS_MENUS_VIBE_ON_WRAP
409+
menu_layer_set_scroll_vibe_on_wrap(&data->menu_layer, true);
410+
#endif
411+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
412+
menu_layer_set_scroll_vibe_on_blocked(&data->menu_layer, true);
413+
#endif
405414
layer_add_child(&data->window.layer, menu_layer_get_layer(&data->menu_layer));
406415

407416
status_bar_layer_init(&data->status_layer);

src/fw/apps/system_apps/health/health_detail_card.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,15 @@ HealthDetailCard *health_detail_card_create(const HealthDetailCardConfig *config
391391
menu_layer_set_normal_colors(menu_layer, detail_card->bg_color, GColorWhite);
392392
menu_layer_set_highlight_colors(menu_layer, detail_card->bg_color, GColorBlack);
393393
menu_layer_set_click_config_onto_window(menu_layer, &detail_card->window);
394+
#if FW_APPS_MENUS_WRAP
395+
menu_layer_set_scroll_wrap_around(menu_layer, true);
396+
#endif
397+
#if FW_APPS_MENUS_VIBE_ON_WRAP
398+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
399+
#endif
400+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
401+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
402+
#endif
394403
layer_add_child(&detail_card->window.layer, menu_layer_get_layer(menu_layer));
395404

396405
// setup content indicators

src/fw/apps/system_apps/launcher/default/launcher_menu_layer.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,15 @@ void launcher_menu_layer_init(LauncherMenuLayer *launcher_menu_layer,
202202
.get_cell_height = prv_menu_layer_get_cell_height,
203203
.selection_will_change = prv_menu_layer_selection_will_change,
204204
});
205+
#if FW_APPS_MENUS_WRAP
206+
menu_layer_set_scroll_wrap_around(menu_layer, true);
207+
#endif
208+
#if FW_APPS_MENUS_VIBE_ON_WRAP
209+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
210+
#endif
211+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
212+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
213+
#endif
205214

206215
// Only setup the content indicator on round
207216
#if PBL_ROUND

src/fw/apps/system_apps/notifications_app.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,15 @@ static void prv_window_load(Window *window) {
701701
GColorWhite);
702702

703703
menu_layer_set_click_config_onto_window(menu_layer, window);
704+
#if FW_APPS_MENUS_WRAP
705+
menu_layer_set_scroll_wrap_around(menu_layer, true);
706+
#endif
707+
#if FW_APPS_MENUS_VIBE_ON_WRAP
708+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
709+
#endif
710+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
711+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
712+
#endif
704713
layer_add_child(&window->layer, menu_layer_get_layer(menu_layer));
705714

706715
TextLayer *text_layer = &data->text_layer;

src/fw/apps/system_apps/send_text/send_text.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,15 @@ static void prv_init(void) {
325325

326326
menu_layer_set_highlight_colors(&data->menu_layer, SEND_TEXT_APP_HIGHLIGHT_COLOR, GColorWhite);
327327
menu_layer_set_click_config_onto_window(&data->menu_layer, &data->window);
328+
#if FW_APPS_MENUS_WRAP
329+
menu_layer_set_scroll_wrap_around(&data->menu_layer, true);
330+
#endif
331+
#if FW_APPS_MENUS_VIBE_ON_WRAP
332+
menu_layer_set_scroll_vibe_on_wrap(&data->menu_layer, true);
333+
#endif
334+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
335+
menu_layer_set_scroll_vibe_on_blocked(&data->menu_layer, true);
336+
#endif
328337
layer_add_child(&data->window.layer, menu_layer_get_layer(&data->menu_layer));
329338

330339
StatusBarLayer *status_layer = &data->status_layer;

src/fw/apps/system_apps/settings/settings.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ static void prv_window_load(Window *window) {
9292
shell_prefs_get_settings_menu_highlight_color(),
9393
GColorWhite);
9494
menu_layer_set_click_config_onto_window(menu_layer, &data->window);
95+
#if FW_APPS_MENUS_WRAP
96+
menu_layer_set_scroll_wrap_around(menu_layer, true);
97+
#endif
98+
#if FW_APPS_MENUS_VIBE_ON_WRAP
99+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
100+
#endif
101+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
102+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
103+
#endif
95104

96105
layer_add_child(&data->window.layer, menu_layer_get_layer(menu_layer));
97106
}

src/fw/apps/system_apps/settings/settings_system.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,15 @@ static void prv_information_window_load(Window *window) {
305305
});
306306
menu_layer_set_highlight_colors(menu_layer, shell_prefs_get_settings_menu_highlight_color(), GColorWhite);
307307
menu_layer_set_click_config_onto_window(menu_layer, &data->window);
308+
#if FW_APPS_MENUS_WRAP
309+
menu_layer_set_scroll_wrap_around(menu_layer, true);
310+
#endif
311+
#if FW_APPS_MENUS_VIBE_ON_WRAP
312+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
313+
#endif
314+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
315+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
316+
#endif
308317

309318
layer_add_child(&data->window.layer, menu_layer_get_layer(menu_layer));
310319
}
@@ -723,6 +732,15 @@ static void prv_debugging_window_load(Window *window) {
723732
});
724733
menu_layer_set_highlight_colors(menu_layer, shell_prefs_get_settings_menu_highlight_color(), GColorWhite);
725734
menu_layer_set_click_config_onto_window(menu_layer, &data->window);
735+
#if FW_APPS_MENUS_WRAP
736+
menu_layer_set_scroll_wrap_around(menu_layer, true);
737+
#endif
738+
#if FW_APPS_MENUS_VIBE_ON_WRAP
739+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
740+
#endif
741+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
742+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
743+
#endif
726744

727745
layer_add_child(&data->window.layer, menu_layer_get_layer(menu_layer));
728746
}
@@ -1169,6 +1187,15 @@ static void prv_certification_window_load(Window *window) {
11691187
});
11701188
menu_layer_set_highlight_colors(menu_layer, shell_prefs_get_settings_menu_highlight_color(), GColorWhite);
11711189
menu_layer_set_click_config_onto_window(menu_layer, &data->window);
1190+
#if FW_APPS_MENUS_WRAP
1191+
menu_layer_set_scroll_wrap_around(menu_layer, true);
1192+
#endif
1193+
#if FW_APPS_MENUS_VIBE_ON_WRAP
1194+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
1195+
#endif
1196+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
1197+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
1198+
#endif
11721199

11731200
layer_add_child(&data->window.layer, menu_layer_get_layer(menu_layer));
11741201
}

src/fw/apps/system_apps/settings/settings_window.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ static void prv_settings_window_load(Window *window) {
182182
menu_layer_set_normal_colors(menu_layer, GColorWhite, GColorBlack);
183183
menu_layer_set_highlight_colors(menu_layer, shell_prefs_get_settings_menu_highlight_color(), GColorWhite);
184184
menu_layer_set_click_config_onto_window(menu_layer, &data->window);
185+
#if FW_APPS_MENUS_WRAP
186+
menu_layer_set_scroll_wrap_around(menu_layer, true);
187+
#endif
188+
#if FW_APPS_MENUS_VIBE_ON_WRAP
189+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
190+
#endif
191+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
192+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
193+
#endif
185194
layer_add_child(&data->window.layer, menu_layer_get_layer(menu_layer));
186195

187196
SettingsCallbacks *callbacks = prv_get_current_callbacks(data);

src/fw/apps/system_apps/watchfaces.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ static void prv_window_load(Window *window) {
154154
PBL_IF_COLOR_ELSE(GColorJazzberryJam, GColorBlack),
155155
GColorWhite);
156156
menu_layer_set_click_config_onto_window(menu_layer, window);
157+
#if FW_APPS_MENUS_WRAP
158+
menu_layer_set_scroll_wrap_around(menu_layer, true);
159+
#endif
160+
#if FW_APPS_MENUS_VIBE_ON_WRAP
161+
menu_layer_set_scroll_vibe_on_wrap(menu_layer, true);
162+
#endif
163+
#if FW_APPS_MENUS_VIBE_ON_BLOCKED
164+
menu_layer_set_scroll_vibe_on_blocked(menu_layer, true);
165+
#endif
157166
layer_add_child(&window->layer, menu_layer_get_layer(menu_layer));
158167
}
159168

0 commit comments

Comments
 (0)