mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-06 05:19:09 -07:00
Hide move app arrows if not enough apps
This commit is contained in:
@@ -68,15 +68,16 @@ void xtreme_app_scene_interface_mainmenu_on_enter(void* context) {
|
||||
|
||||
variable_item_list_add(var_item_list, "Reset Menu", 0, NULL, app);
|
||||
|
||||
size_t count = CharList_size(app->mainmenu_app_labels);
|
||||
item = variable_item_list_add(
|
||||
var_item_list,
|
||||
"Menu App",
|
||||
CharList_size(app->mainmenu_app_labels),
|
||||
count,
|
||||
xtreme_app_scene_interface_mainmenu_menu_app_changed,
|
||||
app);
|
||||
if(CharList_size(app->mainmenu_app_labels)) {
|
||||
if(count) {
|
||||
app->mainmenu_app_index =
|
||||
CLAMP(app->mainmenu_app_index, CharList_size(app->mainmenu_app_labels) - 1, 0U);
|
||||
CLAMP(app->mainmenu_app_index, count - 1, 0U);
|
||||
char label[13];
|
||||
snprintf(label, 13, "Menu App %u", 1 + app->mainmenu_app_index);
|
||||
variable_item_set_item_label(item, label);
|
||||
@@ -94,6 +95,7 @@ void xtreme_app_scene_interface_mainmenu_on_enter(void* context) {
|
||||
var_item_list, "Move App", 3, xtreme_app_scene_interface_mainmenu_move_app_changed, app);
|
||||
variable_item_set_current_value_text(item, "");
|
||||
variable_item_set_current_value_index(item, 1);
|
||||
variable_item_set_locked(item, count < 2, "Can't move\nwith less\nthan 2 apps!");
|
||||
|
||||
variable_item_list_add(var_item_list, "Remove App", 0, NULL, app);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user