diff --git a/radio/src/thirdparty/libopenui/src/table.cpp b/radio/src/thirdparty/libopenui/src/table.cpp index e0b1424fe..e188dd901 100644 --- a/radio/src/thirdparty/libopenui/src/table.cpp +++ b/radio/src/thirdparty/libopenui/src/table.cpp @@ -38,7 +38,7 @@ void Table::Body::paint(BitmapBuffer * dc) coord_t x; int index = 0; for (auto & line: lines) { - bool highlight = hasFocus() && index == selection; + bool highlight = (index == selection); dc->drawSolidFilledRect(0, y, width(), TABLE_LINE_HEIGHT - 2, highlight ? MENU_HIGHLIGHT_BGCOLOR : TABLE_BGCOLOR); x = 10; for (unsigned i = 0; i < line.values.size(); i++) { @@ -98,6 +98,10 @@ void Table::Body::onEvent(event_t event) onSelect(); } } + else if (event == EVT_KEY_BREAK(KEY_EXIT) && selection >= 0) { + select(-1, true); + Window::onEvent(event); + } else { Window::onEvent(event); } diff --git a/radio/src/thirdparty/libopenui/src/table.h b/radio/src/thirdparty/libopenui/src/table.h index f8c00eb78..5658e7eb8 100644 --- a/radio/src/thirdparty/libopenui/src/table.h +++ b/radio/src/thirdparty/libopenui/src/table.h @@ -176,6 +176,10 @@ class Table: public FormField { void setFocus(uint8_t flag) override { + if (body.selection < 0) { + body.selection = 0; + body.invalidate(); + } body.setFocus(flag); }