mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Trial for displaying optional string on right column for submenus
This commit is contained in:
parent
457afbcaf0
commit
ed09ee4a9b
3 changed files with 27 additions and 1 deletions
|
@ -234,6 +234,13 @@ static int cmsDrawMenuEntry(displayPort_t *pDisplay, OSD_Entry *p, uint8_t row)
|
|||
case OME_Funcall:
|
||||
if (IS_PRINTVALUE(p)) {
|
||||
cnt = displayWrite(pDisplay, RIGHT_MENU_COLUMN(pDisplay), row, ">");
|
||||
|
||||
// Special case of sub menu entry with func used as a function
|
||||
// returning a string to print on the right column.
|
||||
if (p->type == OME_Submenu && p->func) {
|
||||
if (p->flags & OPTSTRING)
|
||||
cnt += displayWrite(pDisplay, RIGHT_MENU_COLUMN(pDisplay) + 1, row, ((CMSMenuOptFuncPtr)p->func)());
|
||||
}
|
||||
CLR_PRINTVALUE(p);
|
||||
}
|
||||
break;
|
||||
|
@ -645,6 +652,11 @@ STATIC_UNIT_TESTED uint16_t cmsHandleKey(displayPort_t *pDisplay, uint8_t key)
|
|||
|
||||
switch (p->type) {
|
||||
case OME_Submenu:
|
||||
if (p->func && key == KEY_RIGHT) {
|
||||
cmsMenuChange(pDisplay, p->data);
|
||||
res = BUTTON_PAUSE;
|
||||
}
|
||||
break;
|
||||
case OME_Funcall:
|
||||
case OME_OSD_Exit:
|
||||
if (p->func && key == KEY_RIGHT) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue