mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 06:54:19 +00:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
commit
548d370ab9
2 changed files with 28 additions and 0 deletions
|
@ -338,6 +338,26 @@ void submenu_change_item_label(Submenu* submenu, uint32_t index, const char* lab
|
|||
true);
|
||||
}
|
||||
|
||||
void submenu_change_item_label(Submenu* submenu, uint32_t index, const char* label) {
|
||||
furi_check(submenu);
|
||||
furi_check(label);
|
||||
|
||||
with_view_model(
|
||||
submenu->view,
|
||||
SubmenuModel * model,
|
||||
{
|
||||
SubmenuItemArray_it_t it;
|
||||
for(SubmenuItemArray_it(it, model->items); !SubmenuItemArray_end_p(it);
|
||||
SubmenuItemArray_next(it)) {
|
||||
if(index == SubmenuItemArray_cref(it)->index) {
|
||||
furi_string_set_str(SubmenuItemArray_cref(it)->label, label);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
true);
|
||||
}
|
||||
|
||||
void submenu_reset(Submenu* submenu) {
|
||||
furi_check(submenu);
|
||||
view_set_orientation(submenu->view, ViewOrientationHorizontal);
|
||||
|
|
|
@ -81,6 +81,14 @@ void submenu_add_lockable_item(
|
|||
*/
|
||||
void submenu_change_item_label(Submenu* submenu, uint32_t index, const char* label);
|
||||
|
||||
/** Change label of an existing item
|
||||
*
|
||||
* @param submenu Submenu instance
|
||||
* @param index The index of the item
|
||||
* @param label The new label
|
||||
*/
|
||||
void submenu_change_item_label(Submenu* submenu, uint32_t index, const char* label);
|
||||
|
||||
/** Remove all items from submenu
|
||||
*
|
||||
* @param submenu Submenu instance
|
||||
|
|
Loading…
Reference in a new issue